Pārlūkot izejas kodu

[#1] chore: improve deployment script robustness with git reset --hard

Lange François 3 nedēļas atpakaļ
vecāks
revīzija
6b5d5240e8
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  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 stash && rm -f git_version.txt git_id.txt && git pull && git stash clear && sed -i 's/^LLM_MODEL=.*/LLM_MODEL={local_model}/' .env && docker-compose up -d --build"
+        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"
         print(f"Executing: {command}")
         
         stdin, stdout, stderr = ssh.exec_command(command)