-
Notifications
You must be signed in to change notification settings - Fork 40
/
build.sh
40 lines (33 loc) · 1.07 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
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
if [[ "${TRACE-0}" == "1" ]]; then
set -o xtrace
fi
if [[ "${1-}" =~ ^-*h(elp)?$ ]]; then
echo -e '
\033[1;32mGocesiumtiler build script\033[0m
Usage: ./build.sh
This script automates the building of Gocesiumtiler via Dockerfiles.
Succesfully compiled binaries will be copied into a ../build subdiractory.
Note that this directory is wiped out every time the script is invoked.
'
exit
fi
main() {
BoldGreen='\033[1;32m'
Blue='\033[0;34m'
Cyan='\033[0;36m'
echo -e "${BoldGreen}Gocesiumtiler build script"
echo -ne "${Blue} => Removing old build artifacts... "
rm -rf "./build"
echo -e "${Blue}done"
echo -e "${Blue} => Starting dockerized build... "
build_id="$(date +"%Y%m%d%H%M%S-%N")"
echo -e "${Blue} => Build id: $build_id"#
echo -e "${Blue} => Building..."
docker build -t gocesiumtiler:build --target=final --output ./build --build-arg BUILD_ID=$build_id .
echo -e "${BoldGreen}=> Build complete, artifacts saved in: $(readlink -f ./build)"
}
main