This repository has been archived on 2024-07-30. You can view files and clone it, but cannot push or open issues or pull requests.
Auto-Homelab/scripts/deploy.sh

28 lines
623 B
Bash
Raw Normal View History

2024-06-09 00:51:20 -04:00
#!/bin/bash
# Get folder name from command-line argument
folder="$1"
echo "Deploying to folder: $folder"
case $folder in
arrs)
host="${{ secrets.ARRS_IP }}"
;;
ag_main)
host="${{ secrets.AGMAIN_IP }}"
;;
downloaders)
host="${{ secrets.DOWNLOADERS_IP }}"
;;
# Add cases for other folders/hosts
*)
echo "Unknown folder: $folder"
exit 1
;;
esac
echo "Deploying to host: $host"
# SSH command to deploy to the host
ssh -o StrictHostKeyChecking=no mafyuh@$host "cd /Auto-Homelab/$folder && git pull && docker-compose up -d" || echo "Failed to deploy to $host for folder $folder"