forked from spiffe/spire
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·69 lines (57 loc) · 1.48 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
#!/bin/bash
red=$(which tput > /dev/null && tput setaf 1 2>/dev/null || echo "")
yellow=$(which tput > /dev/null && tput setaf 3 2>/dev/null || echo "")
reset=$(which tput > /dev/null && tput sgr0 2>/dev/null || echo "")
unsupported() {
echo "${yellow}\"build.sh $1\" is no longer necessary or supported.${reset}" 1>&2
exit 1
}
build_protobuf() {
make protogen
}
build_protobuf_verify() {
make protogen-check
}
build_binaries() {
make build
}
build_test() {
make test
}
build_race_test() {
make race-test
}
build_integration() {
make integration
}
build_artifact() {
make artificaft
}
build_all() {
make all
}
cat << EOF 1>&2
${red}!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!! build.sh is deprecated and will be removed in the future !!!
!!! !!!
!!! Please invoke the Makefile directly via \`make\` !!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
${reset}
EOF
case "$1" in
env) unsupported "$1" ;;
setup) unsupported "$1" ;;
utils) unsupported "$1" ;;
protobuf) build_protobuf ;;
protobuf_verify) build_protobuf_verify ;;
binaries|bin) build_binaries "$2" ;;
test) build_test ;;
race-test) build_race_test ;;
integration) build_integration ;;
artifact) build_artifact ;;
release) unsupported "$1" ;;
clean) unsupported "$1" ;;
distclean) unsupported "$1" ;;
all) build_all ;;
*) compgen -A function build_ | sed 's/build_/build.sh /' ;;
esac