Skip to content

Commit 6e16b9f

Browse files
authored
Merge pull request kubernetes-sigs#4 from neolit123/hack-ci
hack: include verify scripts based on cluster-api-provider-docker
2 parents 6a5390b + 1b16b39 commit 6e16b9f

24 files changed

+919
-4
lines changed

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Custom Information - if you're copying this template for the first time you can
2525
2626
## Contact Information
2727
28-
- [Slack channel](https://kubernetes.slack.com/messages/kubernetes-users) - Replace `kubernetes-users` with your slack channel string, this will send users directly to your channel.
28+
- [Slack channel](https://kubernetes.slack.com/messages/kubernetes-users) - Replace `kubernetes-users` with your slack channel string, this will send users directly to your channel.
2929
- [Mailing list](URL)
3030
3131
-->

OWNERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ approvers:
44
- chuckha
55
- cluster-api-admins
66
- cluster-api-maintainers
7-
- sig-cluster-lifecycle-leads
7+
- sig-cluster-lifecycle-leads

OWNERS_ALIASES

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ aliases:
1212
cluster-api-maintainers:
1313
- justinsb
1414
- detiber
15-
- vincepri
15+
- vincepri

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ The Kubernetes Template Project is a template for starting new projects in the G
77
- a `CONTRIBUTING.md` outlining how to contribute to the project
88
- an unmodified copy of `code-of-conduct.md` from this repo, which outlines community behavior and the consequences of breaking the code
99
- a `LICENSE` which must be Apache 2.0 for code projects, or [Creative Commons 4.0] for documentation repositories, without any custom content
10-
- a `SECURITY_CONTACTS` with the contact points for the Product Security Team
10+
- a `SECURITY_CONTACTS` with the contact points for the Product Security Team
1111
to reach out to for triaging and handling of incoming issues. They must agree to abide by the
1212
[Embargo Policy](https://git.k8s.io/security/private-distributors-list.md#embargo-policy)
1313
and will be removed and replaced if they violate that agreement.

go.mod

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module sigs.k8s.io/cluster-api-bootstrap-provider-kubeadm
2+
3+
go 1.12

go.sum

Whitespace-only changes.

hack/update-all.sh

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env bash
2+
# Copyright 2019 The Kubernetes Authors.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
set -o errexit
17+
set -o nounset
18+
set -o pipefail
19+
20+
# shellcheck source=/dev/null
21+
source "$(dirname "$0")/utils.sh"
22+
REPO_PATH=$(get_root_path)
23+
24+
"${REPO_PATH}"/hack/update-deps.sh
25+
"${REPO_PATH}"/hack/update-gofmt.sh

hack/update-deps.sh

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env bash
2+
# Copyright 2019 The Kubernetes Authors.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
17+
set -o nounset
18+
set -o errexit
19+
set -o pipefail
20+
21+
# shellcheck source=/dev/null
22+
source "$(dirname "$0")/utils.sh"
23+
# cd to the root path
24+
cd_root_path
25+
26+
export GO111MODULE="on"
27+
go mod tidy

hack/update-gofmt.sh

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env bash
2+
# Copyright 2019 The Kubernetes Authors.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
# script to run gofmt over our code (not vendor)
17+
set -o errexit
18+
set -o nounset
19+
set -o pipefail
20+
21+
# shellcheck source=/dev/null
22+
source "$(dirname "$0")/utils.sh"
23+
# cd to the root path
24+
cd_root_path
25+
26+
# update go fmt
27+
go fmt ./...

hack/utils.sh

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env bash
2+
# Copyright 2019 The Kubernetes Authors.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
# get_root_path returns the root path of the project source tree
17+
get_root_path() {
18+
echo "$(git rev-parse --show-toplevel)"
19+
}
20+
21+
# cd_root_path cds to the root path of the project source tree
22+
cd_root_path() {
23+
cd "$(get_root_path)" || exit
24+
}

hack/verify-all.sh

+94
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
#!/usr/bin/env bash
2+
# Copyright 2019 The Kubernetes Authors.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
set -o errexit
17+
set -o nounset
18+
set -o pipefail
19+
20+
# shellcheck source=/dev/null
21+
source "$(dirname "$0")/utils.sh"
22+
23+
# set REPO_PATH
24+
REPO_PATH=$(get_root_path)
25+
cd "${REPO_PATH}"
26+
27+
# exit code, if a script fails we'll set this to 1
28+
res=0
29+
30+
# run all verify scripts, optionally skipping any of them
31+
32+
if [[ "${VERIFY_WHITESPACE:-true}" == "true" ]]; then
33+
echo "[*] Verifying whitespace..."
34+
hack/verify-whitespace.sh || res=1
35+
cd "${REPO_PATH}"
36+
fi
37+
38+
if [[ "${VERIFY_SPELLING:-true}" == "true" ]]; then
39+
echo "[*] Verifying spelling..."
40+
hack/verify-spelling.sh || res=1
41+
cd "${REPO_PATH}"
42+
fi
43+
44+
if [[ "${VERIFY_BOILERPLATE:-true}" == "true" ]]; then
45+
echo "[*] Verifying boilerplate..."
46+
hack/verify-boilerplate.sh || res=1
47+
cd "${REPO_PATH}"
48+
fi
49+
50+
if [[ "${VERIFY_GOFMT:-true}" == "true" ]]; then
51+
echo "[*] Verifying gofmt..."
52+
hack/verify-gofmt.sh || res=1
53+
cd "${REPO_PATH}"
54+
fi
55+
56+
if [[ "${VERIFY_GOLINT:-true}" == "true" ]]; then
57+
echo "[*] Verifying golint..."
58+
hack/verify-golint.sh || res=1
59+
cd "${REPO_PATH}"
60+
fi
61+
62+
if [[ "${VERIFY_GOVET:-true}" == "true" ]]; then
63+
echo "[*] Verifying govet..."
64+
hack/verify-govet.sh || res=1
65+
cd "${REPO_PATH}"
66+
fi
67+
68+
if [[ "${VERIFY_DEPS:-true}" == "true" ]]; then
69+
echo "[*] Verifying deps..."
70+
hack/verify-deps.sh || res=1
71+
cd "${REPO_PATH}"
72+
fi
73+
74+
if [[ "${VERIFY_GOTEST:-true}" == "true" ]]; then
75+
echo "[*] Verifying gotest..."
76+
hack/verify-gotest.sh || res=1
77+
cd "${REPO_PATH}"
78+
fi
79+
80+
if [[ "${VERIFY_BUILD:-true}" == "true" ]]; then
81+
echo "[*] Verifying build..."
82+
hack/verify-build.sh || res=1
83+
cd "${REPO_PATH}"
84+
fi
85+
86+
# exit based on verify scripts
87+
if [[ "${res}" = 0 ]]; then
88+
echo ""
89+
echo "All verify checks passed, congrats!"
90+
else
91+
echo ""
92+
echo "One or more verify checks failed! See output above..."
93+
fi
94+
exit "${res}"

0 commit comments

Comments
 (0)