This repository has been archived by the owner on Jul 9, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e5940d3
commit fdf901d
Showing
6 changed files
with
55 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
chmod 600 deploy/deploy_key; | ||
cat deploy/update_app.sh | ssh -oStrictHostKeyChecking=no -i deploy/deploy_key "$DEPLOY_USER@$DEPLOY_SERVER" |
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
backend/start-production.sh → deploy/start-production-backend.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" | ||
cd "$DIR" | ||
. venv/bin/activate | ||
. ~/venv/bin/activate | ||
gunicorn -w 4 --access-logfile - --error-logfile - sahkopiikki.wsgi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/bin/bash | ||
. .bashrc | ||
nvm use 10 | ||
APP_DIR=~/sahkopiikki | ||
cd "$APP_DIR" | ||
|
||
echo "# Starting deployment." | ||
set -e # Fail the script on any errors. | ||
|
||
echo "# Stashing local changes to tracked files." | ||
git stash | ||
|
||
echo "# Fetching remote." | ||
git fetch --all | ||
|
||
echo "# Checking out production." | ||
git checkout production | ||
|
||
echo "# Pulling latest changes." | ||
git pull | ||
|
||
echo "# Navigating to the frontend directory." | ||
cd frontend | ||
|
||
echo "# Installing Node.js dependencies." | ||
npm ci | ||
|
||
echo "# Building the frontend project." | ||
npm run build | ||
|
||
echo "# Setting new build as the active build." | ||
rm -rf "$APP_DIR/frontend/dist" | ||
mv "$APP_DIR/frontend/build" "$APP_DIR/frontend/dist" | ||
|
||
echo "# Navigating to the backend directory." | ||
cd ../backend | ||
|
||
echo "# Activating virtualenv." | ||
set +e # The activate script might return non-zero even on success | ||
source venv/bin/activate | ||
set -e | ||
|
||
echo "# Installing pip requirements." | ||
pip install -r requirements.txt | ||
|
||
echo "# Restarting the backend service." | ||
sudo systemctl restart sahkopiikki | ||
|
||
set +e | ||
echo "# Deployment done!" |