-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathdeploy
executable file
·75 lines (67 loc) · 2.17 KB
/
deploy
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#! /bin/bash
bold=$(tput bold)
dim=$(tput dim)
smul=$(tput smul) # Enable underline mode
rmul=$(tput rmul) # Disable underline mode
noformat=$(tput sgr0)
build_status=1
old_build=""
read -p "Did you update ${bold}_version.py${noformat}? y/n (Default: n) " -n 4 -r
if [[ $REPLY =~ ^[Yy].*$ ]]; then
echo ""
echo "Build client? y/n (Default: y)"
read -p "If not, the most recent build will be used " -n 4 -r
if [[ $REPLY =~ ^[Yy].*$ ]]; then
echo ""
read -p "(r)elease or (d)ev build? (Default: r) " -n 8 -r
if [[ $REPLY =~ ^[Dd].*$ ]]; then
./build_client dev
build_status=$?
else
./build_client prod
build_status=$?
fi
else
# assume previous client build was successful
build_status=0
old_build="(presumed) "
fi
if [ $build_status == 0 ]; then
echo ""
echo "${dim}===================================================${noformat}"
echo " Client build ${old_build}successful, building egg"
echo "${dim}===================================================${noformat}"
echo ""
./build_egg
build_status=$?
fi
if [ $build_status == 0 ]; then
echo ""
echo "${dim}=====================================${noformat}"
echo " Egg successful, submitting to PyPi"
echo "${dim}=====================================${noformat}"
echo ""
cd python
python setup.py sdist upload -r pypi
cd ..
echo ""
echo "*** ${smul}NOT${rmul} upgrading the server. Please wait a few minutes (to ensure that"
echo " PyPi has serves the most recent loompy version), then upgrade"
echo " manually as follows:"
echo ""
echo "- SSH into the server: ${bold}gcloud compute ssh ubuntu@loom --zone \"us-central1-a\"${noformat}"
echo "- Upgrade Loom: ${bold}upgrade_loom${noformat}"
echo ""
else
echo ""
echo " ${bold}Build not finished properly${noformat}"
echo " ${bold}Aborting upload to PyPi${noformat}"
echo ""
exit $build_status
fi
else
echo ""
echo " ${bold}PyPi requires a version bump to accept uploads${noformat}"
echo " ${bold}Please update ./python/loom_viewer/_version.py${noformat}"
echo " Cancelling build + upload to PyPi"
fi