The reason I want to deploy the same code (api server) in multiple apps is because each app has a different IP, my api server calls a different public api and has a very tight api rate limit based on ip and the way I’m currently trying to do this is manually typing this every time
fly deploy -a app1
fly deploy -a app2
fly deploy -a app3
#!/bin/bash
# Define an array of app names
apps=("app1" "app2" "app3")
# Loop through each app name and deploy
for app in "${apps[@]}"; do
echo "Deploying to $app..."
fly deploy -a "$app"
done
chmod +x deploy_to_multiple_apps.sh
./deploy_to_multiple_apps.sh
Here a python method
import subprocess
# List of apps to deploy to
apps = ["app1", "app2", "app3"]
# Loop through each app and deploy
for app in apps:
print(f"Deploying to {app}...")
subprocess.run(["fly", "deploy", "-a", app])
python deploy_to_multiple_apps.py