1
+ #! /bin/bash
2
+
3
+ # Copyright 2014 The Kubernetes Authors All rights reserved.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ set -o errexit
18
+ set -o nounset
19
+ set -o pipefail
20
+
21
+ KUBE_ROOT=$( dirname " ${BASH_SOURCE} " ) /..
22
+ source " ${KUBE_ROOT} /cluster/kube-env.sh"
23
+
24
+ SILENT=true
25
+
26
+ function is-excluded {
27
+ for e in $EXCLUDE ; do
28
+ if [[ $1 -ef ${BASH_SOURCE} ]]; then
29
+ return
30
+ fi
31
+ if [[ $1 -ef " $KUBE_ROOT /hack/$e " ]]; then
32
+ return
33
+ fi
34
+ done
35
+ return 1
36
+ }
37
+
38
+ while getopts " :v" opt; do
39
+ case $opt in
40
+ v)
41
+ SILENT=false
42
+ ;;
43
+ \? )
44
+ echo " Invalid flag: -$OPTARG " >&2
45
+ exit 1
46
+ ;;
47
+ esac
48
+ done
49
+
50
+ if $SILENT ; then
51
+ echo " Running in the silent mode, run with -v if you want to see script logs."
52
+ fi
53
+
54
+ EXCLUDE=" verify-godeps.sh"
55
+
56
+ for t in ` ls $KUBE_ROOT /hack/verify-* .sh`
57
+ do
58
+ if is-excluded $t ; then
59
+ echo " Skipping $t "
60
+ continue
61
+ fi
62
+ if $SILENT ; then
63
+ echo -e " Verifying $t "
64
+ bash " $t " & > /dev/null && echo -e " ${color_green} SUCCESS${color_norm} " || echo -e " ${color_red} FAILED${color_norm} "
65
+ else
66
+ bash " $t " || true
67
+ fi
68
+ done
69
+
70
+ for t in ` ls $KUBE_ROOT /hack/verify-* .py`
71
+ do
72
+ if is-excluded $t ; then
73
+ echo " Skipping $t "
74
+ continue
75
+ fi
76
+ if $SILENT ; then
77
+ echo -e " Verifying $t "
78
+ python " $t " & > /dev/null && echo -e " ${color_green} SUCCESS${color_norm} " || echo -e " ${color_red} FAILED${color_norm} "
79
+ else
80
+ python " $t " || true
81
+ fi
82
+ done
0 commit comments