diff --git a/Makefile b/Makefile index b068ecc..0717208 100644 --- a/Makefile +++ b/Makefile @@ -21,11 +21,13 @@ deploy: build deploy-server: @echo "Deploying to remote server $(SERVER_IP)..." - @# Generate temporary merged YAML for server in /tmp to avoid WSL permissions + @# Build image on the remote server + ssh $(SERVER_USER)@$(SERVER_IP) "cd $(SERVER_PATH) && sudo podman build -t $(IMG) ." + @# Generate temporary merged YAML for server in /tmp @sudo kubectl create configmap mkm-admin-config --from-env-file=.env --dry-run=client -o yaml > /tmp/server_deploy.yaml @echo "---" >> /tmp/server_deploy.yaml @cat k8s/deployment.yaml >> /tmp/server_deploy.yaml - @# Single SCP/SSH call to reduce password prompts + @# Single SCP/SSH call to apply 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 -f /tmp/server_deploy.yaml" @rm -f /tmp/server_deploy.yaml