File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ set -e
3+
4+ HOST=" $1 "
5+ if [[ -z " $HOST " ]]; then
6+ echo " Usage: $0 <ec2-ip-address>"
7+ exit 1
8+ fi
9+
10+ SSH_TARGET=" ubuntu@$HOST "
11+
12+ echo " ==> Fetching secrets from Heroku..."
13+ ENV_FILE=$( mktemp)
14+ heroku config --app geoinsight --shell > " $ENV_FILE "
15+
16+ echo " ==> Uploading env file to remote machine..."
17+ scp " $ENV_FILE " " $SSH_TARGET :/home/ubuntu/geoinsight.prod.env"
18+ rm " $ENV_FILE "
19+
20+ echo " ==> Pulling changes..."
21+ ssh " $SSH_TARGET " ' cd /home/ubuntu/geoinsight && git pull'
22+
23+ echo " ==> Adding SOURCE_VERSION to env file..."
24+ ssh " $SSH_TARGET " ' echo "SOURCE_VERSION=$(git -C /home/ubuntu/geoinsight rev-parse HEAD)" >> /home/ubuntu/geoinsight.prod.env'
25+
26+ echo " ==> Restarting celery service..."
27+ ssh " $SSH_TARGET " ' sudo systemctl restart celery'
28+
29+ echo " ==> Done! Celery worker is restarted on $HOST "
You can’t perform that action at this time.
0 commit comments