From 528c44bcb1074ac98ee569ce8b461875147a710c Mon Sep 17 00:00:00 2001 From: Marc LeBlanc Date: Fri, 15 Mar 2024 16:31:47 +0300 Subject: [PATCH] Fixing pull-start.sh --- repo-converter/pull-start.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/repo-converter/pull-start.sh b/repo-converter/pull-start.sh index 0781b27..5ab9289 100644 --- a/repo-converter/pull-start.sh +++ b/repo-converter/pull-start.sh @@ -13,9 +13,14 @@ log_file="$repo_converter_dir/pull-start.log" date_time=$(date +"%F %T") echo "$date_time - Starting $0" >> "$log_file" -command="git -C $repo_converter_dir pull && docker compose -f $repo_converter_dir/docker-compose.yaml pull && docker compose -f $repo_converter_dir/docker-compose.yaml up -d --remove-orphans" +command="\ + sudo git -C $repo_converter_dir reset --hard && \ + sudo git -C $repo_converter_dir pull --force && \ + sudo docker compose -f $repo_converter_dir/docker-compose.yaml pull && \ + sudo docker compose -f $repo_converter_dir/docker-compose.yaml up -d --remove-orphans \ + " -bash -c "$command" >> "$log_file" 2>&1 +sudo bash -c "$command" 2>&1 | sudo tee -a file "$log_file" date_time=$(date +"%F %T") echo "$date_time - Finishing $0" >> "$log_file"