-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.sh
executable file
·71 lines (57 loc) · 1.42 KB
/
build.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
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
#! /bin/bash
################################################################################
#
# UNETTEST BUILD SCRIP
#
# builds:
# - UNETTEST
# - docs
#
# uploads:
# - unettest
# - docs
#
################################################################################
function build_and_deploy_binary {
echo '#### FRESH BUILD ####'
mySys="$(uname -s)"
case "${mySys}" in
Darwin)
BUILDTARGET="mac"
;;
Linux)
BUILDTARGET="nix"
;;
esac
pyinstaller unettest.py -p ~/.venvs/unettest/lib/python3.7/site-packages --onefile --name unettest.$BUILDTARGET
sha_val=$( shasum -a 256 dist/unettest.$BUILDTARGET )
echo $sha_val > unettest.$BUILDTARGET-sha256
aws s3 cp ./dist/unettest.$BUILDTARGET s3://unettest/ --acl public-read
aws s3 cp ./unettest.$BUILDTARGET-sha256 s3://unettest/ --acl public-read
}
function build_and_deploy_docs {
echo '#### DOCUMENTATION ####'
sphinx-build -b html ./docs ./docs/build
./rm_nav_header.sh
aws s3 cp ./docs/build s3://unettest.net/ --recursive --acl public-read
aws s3 cp ./docs/blog s3://unettest.net/ --recursive --acl public-read
}
if [ -z $1 ] ; then
echo "going to do docs and binary!"
build_and_deploy_binary
build_and_deploy_docs
else
case $1 in
"docs")
echo "going to do docs!"
build_and_deploy_docs
;;
"binary")
echo "going to do binary!"
build_and_deploy_binary
;;
*)
echo "run ./build.sh with either \`docs\` or \`binary\`"
;;
esac
fi