-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sh
56 lines (39 loc) · 1.61 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
#!/bin/bash
set -e;
set -u;
####################################################################################################
## Options
####################################################################################################
# Default options
option_delta_updates=false; # Only build delta layer at the base image level?
# Parse command line options
while [ "$#" -gt 0 ]
do
case "$1" in
# unknown
*)
echo "Error: unknown option '${1}'. Exiting." >&2;
exit 12;
;;
esac
shift
done;
####################################################################################################
## Helper Functions
####################################################################################################
# Custom sigterm handler, so that interupt signals terminate the script, not just a single command.
sigterm_handler() {
echo -e "\n";
exit 1;
}
trap 'trap " " SIGINT SIGTERM SIGHUP; kill 0; wait; sigterm_handler' SIGINT SIGTERM SIGHUP;
####################################################################################################
## Build
####################################################################################################
echo -e '\n\033[1m[Build Full Image]\033[0m';
docker build . -f linux.Dockerfile --rm -t lacledeslan/gamesvr-7daystodie:latest --no-cache --pull --build-arg BUILDNODE="$(cat /proc/sys/kernel/hostname)";
#echo -e '\n\033[1m[Running Image Self-Checks]\033[0m';
echo -e "no self checks to run";
echo -e '\n\033[1m[Pushing to Docker Hub]\033[0m';
echo "> push lacledeslan/gamesvr-7daystodie:latest"
docker push lacledeslan/gamesvr-7daystodie:latest