-
Notifications
You must be signed in to change notification settings - Fork 57
/
Copy pathdeploy.sh
executable file
·44 lines (33 loc) · 1.15 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
40
41
42
43
44
#!/bin/bash
#
# Checks pre-deploy safeguards - tests, app keys, package versions - then deploys.
#
# Expects that your local bridgy, granary, and oauth-dropins repos are all in
# the same directory, and that you have gcloud installed.
set -e
src=`dirname $0`/../..
# run unit tests
pkill datastore || true
gcloud beta emulators datastore start --no-store-on-disk ----use-firestore-in-datastore-mode --host-port=localhost:8089 < /dev/null >& /dev/null &
sleep 2s
cd $src/bridgy && source local/bin/activate
cd ../oauth-dropins
python -m unittest discover --pattern="test_*.py"
cd ../granary
python -m unittest discover
cd ../bridgy
python -m unittest discover -s tests -t .
kill %1 # datastore emulator
# check silo app keys (aka client ids)
md5sum -c keys.md5
# # TODO: check package versions
# missing=`pip freeze -q -r requirements.txt | join --nocheck-order -v 2 - requirements.txt`
# if [[ "$missing" != "" ]]; then
# echo 'ERROR: Package version mismatch! Expected:'
# echo $missing
# exit 1
# fi
# echo 'Package versions OK.'
# deploy!
# https://cloud.google.com/sdk/gcloud/reference/app/deploy
gcloud -q beta app deploy --no-cache --project brid-gy *.yaml