-
Notifications
You must be signed in to change notification settings - Fork 0
/
ci-main.sh
executable file
·56 lines (44 loc) · 1.1 KB
/
ci-main.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
fatal()
{
echo "ci-main.sh: fatal: $1" 1>&2
exit 1
}
info()
{
echo "ci-main.sh: info: $1" 1>&2
}
if [ $# -ne 1 ]
then
fatal "usage: build-type
Where: build-type is one of 'pull-request' or 'normal'
"
fi
BUILD_TYPE="$1"
shift
CI_BIN_DIRECTORY=$(realpath .ci) ||
fatal "could not determine bin directory"
export PATH="${PATH}:${CI_BIN_DIRECTORY}:."
case ${BUILD_TYPE} in
setup-only)
info "Building in setup-only mode"
info "Credentials will be used"
info "No builds will be produced"
info "Builds will not be deployed"
ci-credentials.sh || fatal "Could not set up credentials"
;;
pull-request)
info "Building in pull-request mode"
info "Credentials will not be used"
info "Builds will not be deployed"
ci-build.sh pull-request || fatal "Could not build"
;;
normal)
info "Building in normal mode"
info "Credentials will be used"
info "Builds will be deployed"
ci-credentials.sh || fatal "Could not set up credentials"
ci-build.sh normal || fatal "Could not build"
ci-deploy.sh || fatal "Could not deploy"
;;
esac