ci: use rm -f to avoid errors when cleaning up temporary files

The -f flag prevents errors if the files do not exist, ensuring the cleanup step is robust and does not fail the deployment process.
This commit is contained in:
Jp
2026-02-26 11:30:32 +08:00
parent e6acea80a0
commit 5992b28eb5

View File

@@ -27,8 +27,8 @@ deploy-server:
@cat k8s/deployment.yaml >> /tmp/server_deploy.yaml
@# Single SCP/SSH call to reduce password prompts
scp /tmp/server_deploy.yaml $(SERVER_USER)@$(SERVER_IP):/tmp/server_deploy.yaml
ssh $(SERVER_USER)@$(SERVER_IP) "sudo kubectl apply -f /tmp/server_deploy.yaml && rm /tmp/server_deploy.yaml"
@rm /tmp/server_deploy.yaml
ssh $(SERVER_USER)@$(SERVER_IP) "sudo kubectl apply -f /tmp/server_deploy.yaml && rm -f /tmp/server_deploy.yaml"
@rm -f /tmp/server_deploy.yaml
stop:
-podman kube down k8s/deployment.yaml >/dev/null 2>&1