Browse Source

[#1] chore: use force sync fetch-reset in deploy script

Lange François 3 weeks ago
parent
commit
0f4001cecd
1 changed files with 1 additions and 1 deletions
  1. 1 1
      scripts/deploy_to_server.py

+ 1 - 1
scripts/deploy_to_server.py

@@ -35,7 +35,7 @@ def deploy():
         print("Connected successfully!")
         
         local_model = os.environ.get('LLM_MODEL', 'llama3.2:3b')
-        command = f"cd food_project && git reset --hard HEAD && git clean -fd && rm -f git_version.txt git_id.txt && git pull && sed -i 's/^LLM_MODEL=.*/LLM_MODEL={local_model}/' .env && docker-compose up -d --build"
+        command = f"cd food_project && git fetch origin main && git reset --hard origin/main && git clean -fd && rm -f git_version.txt git_id.txt && sed -i 's/^LLM_MODEL=.*/LLM_MODEL={local_model}/' .env && docker-compose up -d --build"
         print(f"Executing: {command}")
         
         stdin, stdout, stderr = ssh.exec_command(command)