From 727f3b95eb02b2169b7144031f45d05ccb5587d2 Mon Sep 17 00:00:00 2001 From: qiaofeng1227 <76487013@qq.com> Date: Mon, 11 Jul 2022 15:29:11 +0800 Subject: [PATCH] Update init.sh.jinja2 --- apps/roles/role_init/templates/init.sh.jinja2 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/roles/role_init/templates/init.sh.jinja2 b/apps/roles/role_init/templates/init.sh.jinja2 index e8f09c40..2803d346 100644 --- a/apps/roles/role_init/templates/init.sh.jinja2 +++ b/apps/roles/role_init/templates/init.sh.jinja2 @@ -6,7 +6,11 @@ sudo sh -c 'echo "init-password started at" $(date -d now) 1>> /tmp/init_debug. #1 init for applist of .env {% for app_name in applist.stdout_lines %} +sudo docker compose -f /data/apps/{{app_name}}/docker-compose.yml down -v sudo sed -i "s/_PASSWORD=.*/_PASSWORD=$new_password/g" /data/apps/{{app_name}}/.env +sudo docker compose -f /data/apps/{{app_name}}/docker-compose.yml up -d --no-recreate {% endfor %} -2 init for applist of special \ No newline at end of file +#2 init for applist of special + +sudo sh -c 'echo "init docker ended at" $(date -d now) 1>> /tmp/init_debug.txt'