-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdeploy.sh
executable file
·39 lines (29 loc) · 1.03 KB
/
deploy.sh
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
#!/bin/bash
echo "Deploying to bloodmallet.com"
# Save start location
start_location=`pwd`
echo -n "Starting virtual environment"
# Activate virtual env (here could be a list search that looks for env, venv and .env instead)
. ~/envs/django_bloodmallet/bin/activate
echo -e " \e[32mDone\e[0m"
echo -n "Preparing Styles"
# Create fresh css files
python manage.py compilescss >/dev/null
echo -e " \e[32mDone\e[0m"
echo -n "Preparing static files"
# Collect fresh css files
python manage.py collectstatic --clear --noinput --ignore=*.scss --ignore=*.po --ignore=*.zip >/dev/null
echo -e " \e[32mDone\e[0m"
# Deploy
gcloud app deploy --no-promote --quiet
gcloud app deploy cron.yaml --quiet
echo -n "Cleaning up"
# remove compiled css files
python manage.py compilescss --delete-files >/dev/null
# Delete created "static" directory
rm -rf static/
# Return to start of script location
cd $start_location
echo -e " \e[32mDone\e[0m"
echo "------------------------------------"
echo "Deployment successful"