File tree Expand file tree Collapse file tree 7 files changed +52
-50
lines changed Expand file tree Collapse file tree 7 files changed +52
-50
lines changed Original file line number Diff line number Diff line change 3
3
set -o nounset
4
4
set -o pipefail
5
5
6
- source " hack/lib/test_lib .sh"
6
+ source " hack/lib/common .sh"
7
7
8
8
echo " Checking format of error and log messages..."
9
9
allfiles=$( listFiles| grep -v ./internal/bindata/...)
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ set -o errexit
4
4
set -o nounset
5
5
set -o pipefail
6
6
7
- source " hack/lib/test_lib .sh"
7
+ source " hack/lib/common .sh"
8
8
9
9
echo " Checking for license header..."
10
10
allfiles=$( listFiles| grep -v ./internal/bindata/...)
Original file line number Diff line number Diff line change 4
4
5
5
source ./hack/lib/common.sh
6
6
7
- header_text " Building the site and checking links "
7
+ header_text " Building the website "
8
8
docker volume create sdk-html
9
+ trap_add " docker volume rm sdk-html" EXIT
9
10
docker run --rm -v " $( pwd) :/src" -v sdk-html:/src/website/public klakegg/hugo:0.73.0-ext-ubuntu -s website
10
- docker run --rm -v sdk-html:/target mtlynch/htmlproofer /target --empty-alt-ignore --http-status-ignore 429 --allow_hash_href
11
- docker volume rm sdk-html
11
+
12
+ header_text " Checking links"
13
+ # For config explanation: https://github.com/gjtorikian/html-proofer#special-cases-for-the-command-line
14
+ docker run --rm -v sdk-html:/target klakegg/html-proofer:latest /target \
15
+ --empty-alt-ignore \
16
+ --http-status-ignore 429 \
17
+ --allow_hash_href \
18
+ --url-ignore " /github.com\/operator-framework\/operator-sdk\/edit\/master\//"
Original file line number Diff line number Diff line change @@ -24,3 +24,43 @@ function header_text {
24
24
function error_text {
25
25
echo " $error_color $* $reset_color "
26
26
}
27
+
28
+ # ===================================================================
29
+ # FUNCTION trap_add ()
30
+ #
31
+ # Purpose: prepends a command to a trap
32
+ #
33
+ # - 1st arg: code to add
34
+ # - remaining args: names of traps to modify
35
+ #
36
+ # Example: trap_add 'echo "in trap DEBUG"' DEBUG
37
+ #
38
+ # See: http://stackoverflow.com/questions/3338030/multiple-bash-traps-for-the-same-signal
39
+ # ===================================================================
40
+ function trap_add() {
41
+ trap_add_cmd=$1 ; shift || fatal " ${FUNCNAME} usage error"
42
+ new_cmd=
43
+ for trap_add_name in " $@ " ; do
44
+ # Grab the currently defined trap commands for this trap
45
+ existing_cmd=` trap -p " ${trap_add_name} " | awk -F" '" ' {print $2}' `
46
+
47
+ # Define default command
48
+ [ -z " ${existing_cmd} " ] && existing_cmd=" echo exiting @ ` date` "
49
+
50
+ # Generate the new command
51
+ new_cmd=" ${trap_add_cmd} ;${existing_cmd} "
52
+
53
+ # Assign the test
54
+ trap " ${new_cmd} " " ${trap_add_name} " || \
55
+ fatal " unable to add to trap ${trap_add_name} "
56
+ done
57
+ }
58
+
59
+ function listPkgDirs() {
60
+ go list -f ' {{.Dir}}' ./cmd/... ./test/... ./internal/... | grep -v generated
61
+ }
62
+
63
+ function listFiles() {
64
+ # pipeline is much faster than for loop
65
+ listPkgDirs | xargs -I {} find {} -name ' *.go' | grep -v generated
66
+ }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
3
source hack/lib/common.sh
4
- source hack/lib/test_lib.sh
5
4
source hack/lib/image_lib.sh
6
5
7
6
set -eu
Original file line number Diff line number Diff line change 3
3
set -eu
4
4
5
5
source hack/lib/common.sh
6
- source hack/lib/test_lib.sh
7
6
source hack/lib/image_lib.sh
8
7
9
8
TMPDIR=" $( mktemp -d -p /tmp memcached-operator-XXXX) "
You can’t perform that action at this time.
0 commit comments