-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·34 lines (26 loc) · 905 Bytes
/
deploy.sh
File metadata and controls
executable file
·34 lines (26 loc) · 905 Bytes
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
#!/bin/bash
cd /home/merv/Developer/source-be-deploy
echo "Pulling changes..."
git pull
echo "Starting compilation..."
export $(grep '.*' .env | xargs)
clojure -T:build uber
echo "Creating archive..."
mkdir source-be-deploy
cp start.sh migrate.sh source-be.service deps.edn target/source-be-standalone.jar source-be-deploy
cp -r resources src source-be-deploy
cp prod.env source-be-deploy/.env
tar -czf source-be-deploy.tar.gz ./source-be-deploy
echo "Copying archive..."
sshpass -e scp -r /home/merv/Developer/source-be-deploy/source-be-deploy.tar.gz deploy@api.wearesource.earth:/home/deploy
echo "Done!"
echo "Setting up prod server..."
sshpass -e ssh deploy@api.wearesource.earth "
echo "Extracting archive..."
tar -xzf source-be-deploy.tar.gz
echo "Restarting service..."
sudo systemctl restart source-fe.service
"
echo "Cleaning up..."
rm -rf source-be-deploy
rm source-be-deploy.tar.gz