-
Notifications
You must be signed in to change notification settings - Fork 0
/
cli
executable file
·57 lines (48 loc) · 1.14 KB
/
cli
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
#!/usr/bin/env bash
set -e
export WORKDIR=$(cd $(dirname $0) && pwd)
cli_help() {
cli_name=${0##*/}
printf "
Boilerplate for Continuous deployment in Kubernetes
Usage: $cli_name [command]
Commands:
${CCGREEN}deploy${CCEND} Deploy application to Kubernetes
${CCGREEN}namespace${CCEND} Deploy namespaces (run this only from the local env)
${CCGREEN}build${CCEND} Build docker images locally
${CCGREEN}test${CCEND} Run CI tests
${CCGREEN}push${CCEND} Build and push docker images to GCP registry
${CCGREEN}check${CCEND} Checks you can run the makefile
${CCGREEN}help${CCEND} Print help
"
exit 1
}
. $WORKDIR/ops/defaults.sh
if [[ "" == $GCP_HOSTNAME ]]
then
echo "ERROR: Can't find $HOME/.kube-test.rc, please create following README.md"
exit 1
fi
case "$1" in
deploy)
"$WORKDIR/ops/deploy.sh" "$2" "$3"
;;
namespace)
"$WORKDIR/ops/namespace.sh" "$2"
;;
build)
"$WORKDIR/ops/build.sh" "$2"
;;
test)
"$WORKDIR/ops/test.sh" "$2" "$3"
;;
push)
"$WORKDIR/ops/push.sh" "$2"
;;
check)
"$WORKDIR/ops/check.sh" "$2"
;;
*)
cli_help
;;
esac