-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmanual_deploy.sh
More file actions
executable file
·43 lines (32 loc) · 1.06 KB
/
Copy pathmanual_deploy.sh
File metadata and controls
executable file
·43 lines (32 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
set -e
# Detect user home correctly even if running with sudo
REAL_USER=${SUDO_USER:-$USER}
REAL_HOME=$(eval echo ~$REAL_USER)
FLY_BIN="$REAL_HOME/.fly/bin/fly"
if [ ! -f "$FLY_BIN" ]; then
echo "Fly CLI not found at $FLY_BIN"
FLY_BIN=$(which fly)
fi
if [ -z "$FLY_BIN" ]; then
echo "Error: Fly CLI not found."
exit 1
fi
echo "Using fly at: $FLY_BIN"
echo "Logging in to registry..."
# Temporary config to bypass creds helper
mkdir -p .docker_tmp
echo '{"credsStore": ""}' > .docker_tmp/config.json
export DOCKER_CONFIG=$(pwd)/.docker_tmp
echo "Getting auth token..."
$FLY_BIN auth token | docker login registry.fly.io -u x --password-stdin
echo "Building image (this may take a while)..."
docker build -t registry.fly.io/bg-parliament-dashboard:latest .
echo "Pushing image..."
docker push registry.fly.io/bg-parliament-dashboard:latest
echo "Deploying..."
# Find fly again for the deployment step (just to be safe)
$FLY_BIN deploy --image registry.fly.io/bg-parliament-dashboard:latest
# Cleanup
rm -rf .docker_tmp
echo "✅ Deployment complete!"