@@ -21,41 +21,53 @@ set -o pipefail
21
21
source " $( dirname " $0 " ) /utils.sh"
22
22
23
23
# set REPO_PATH
24
- REPO_PATH=$( get_root_path)
24
+ readonly REPO_PATH=$( get_root_path)
25
25
cd " ${REPO_PATH} "
26
26
27
+ failure () {
28
+ if [[ " ${1} " != 0 ]]; then
29
+ res=1
30
+ echo " ${2} failed"
31
+ fi
32
+ }
33
+
27
34
# exit code, if a script fails we'll set this to 1
28
35
res=0
29
36
30
37
# run all verify scripts, optionally skipping any of them
31
38
32
39
if [[ " ${VERIFY_WHITESPACE:- true} " == " true" ]]; then
33
40
echo " [*] Verifying whitespace..."
34
- hack/verify-whitespace.sh || res=1
41
+ hack/verify-whitespace.sh
42
+ failure $? " verify-whitespace.sh"
35
43
cd " ${REPO_PATH} "
36
44
fi
37
45
38
46
if [[ " ${VERIFY_SPELLING:- true} " == " true" ]]; then
39
47
echo " [*] Verifying spelling..."
40
- hack/verify-spelling.sh || res=1
48
+ hack/verify-spelling.sh
49
+ failure $? " verify-spelling.sh"
41
50
cd " ${REPO_PATH} "
42
51
fi
43
52
44
53
if [[ " ${VERIFY_BOILERPLATE:- true} " == " true" ]]; then
45
54
echo " [*] Verifying boilerplate..."
46
- hack/verify-boilerplate.sh || res=1
55
+ hack/verify-boilerplate.sh
56
+ failure $? " verify-boilerplate.sh"
47
57
cd " ${REPO_PATH} "
48
58
fi
49
59
50
60
if [[ " ${VERIFY_GOFMT:- true} " == " true" ]]; then
51
61
echo " [*] Verifying gofmt..."
52
- hack/verify-gofmt.sh || res=1
62
+ hack/verify-gofmt.sh
63
+ failure $? " verify-gofmt.sh"
53
64
cd " ${REPO_PATH} "
54
65
fi
55
66
56
67
if [[ " ${VERIFY_GOLINT:- true} " == " true" ]]; then
57
68
echo " [*] Verifying golint..."
58
- hack/verify-golint.sh || res=1
69
+ hack/verify-golint.sh
70
+ failure $? " verify-golint.sh"
59
71
cd " ${REPO_PATH} "
60
72
fi
61
73
67
79
68
80
if [[ " ${VERIFY_DEPS:- true} " == " true" ]]; then
69
81
echo " [*] Verifying deps..."
70
- hack/verify-deps.sh || res=1
82
+ hack/verify-deps.sh
83
+ failure $? " verify-deps.sh"
71
84
cd " ${REPO_PATH} "
72
85
fi
73
86
74
87
if [[ " ${VERIFY_GOTEST:- true} " == " true" ]]; then
75
88
echo " [*] Verifying gotest..."
76
- hack/verify-gotest.sh || res=1
89
+ hack/verify-gotest.sh
90
+ failure $? " verify-gotest.sh"
77
91
cd " ${REPO_PATH} "
78
92
fi
79
93
80
94
if [[ " ${VERIFY_BUILD:- true} " == " true" ]]; then
81
95
echo " [*] Verifying build..."
82
- hack/verify-build.sh || res=1
96
+ hack/verify-build.sh
97
+ failure $? " verify-build.sh"
83
98
cd " ${REPO_PATH} "
84
99
fi
85
100
86
101
if [[ " ${VERIFY_DOCKER_BUILD:- true} " == " true" ]]; then
87
102
echo " [*] Verifying capd-manager docker image build..."
88
- hack/verify-docker-build.sh || res=1
103
+ hack/verify-docker-build.sh
104
+ failure $? " verify-docker-build.sh"
89
105
cd " ${REPO_PATH} "
90
106
fi
91
107
0 commit comments