forked from kubernetes-sigs/kubebuilder
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refac(ci/scripts): centralize code and remove duplications
- Loading branch information
1 parent
1705128
commit f8b626c
Showing
9 changed files
with
36 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,9 +40,7 @@ services: | |
|
||
before_install: | ||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then mkdir -p /Users/travis/gopath/bin; fi | ||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then GO111MODULE=on scripts/install_and_setup.sh $KIND_K8S_VERSION; fi | ||
- GO111MODULE=on go get sigs.k8s.io/controller-tools/cmd/[email protected] | ||
- GO111MODULE=on go get sigs.k8s.io/kustomize/kustomize/[email protected] | ||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then scripts/setup.sh $KIND_K8S_VERSION; fi | ||
|
||
before_script: | ||
|
||
|
@@ -53,11 +51,13 @@ install: | |
- | ||
|
||
script: | ||
- GO111MODULE=on TRACE=1 ./golden_test.sh | ||
- GO111MODULE=on TRACE=1 ./test.sh | ||
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then GO111MODULE=on TRACE=1 PATH=$PATH:$(pwd) ./test_e2e_v1.sh ; fi | ||
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then GO111MODULE=on TRACE=1 PATH=$PATH:$(pwd) ./test_e2e_v2.sh ; fi | ||
# The golden_test.sh check if the the testdata is updated according to the current changes | ||
# To update the testdata use the Makefile targets `make generate-setup` then `make generate-testdata` | ||
- ./golden_test.sh | ||
- ./test.sh | ||
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then PATH=$PATH:$(pwd) ./test_e2e.sh; fi | ||
|
||
# TBD. Suppressing for now. | ||
notifications: | ||
email: false | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,7 +54,7 @@ generate-testdata: ## Update/generate the testdata in $GOPATH/src/sigs.k8s.io/ku | |
GO111MODULE=on ./generate_golden.sh | ||
|
||
.PHONY: generate-vendor | ||
generate-vendor: ## (deprecated) - Update/generate the vendor by using the path $GOPATH/src/sigs.k8s.io/kubebuilder-test | ||
generate-vendor: ## (Deprecated) Update/generate the vendor by using the path $GOPATH/src/sigs.k8s.io/kubebuilder-test | ||
GO111MODULE=off ./generate_vendor.sh | ||
|
||
.PHONY: generate-setup | ||
|
@@ -68,12 +68,11 @@ generate-setup: ## Current workarround to generate the testdata with the correct | |
test: ## Run the go tests ($ go test -v ./cmd/... ./pkg/...) | ||
go test -v ./cmd/... ./pkg/... | ||
|
||
.PHONY: test-project-generation | ||
test-project-generation: ## Run the unit tests (used in the CI) | ||
- go get sigs.k8s.io/[email protected] | ||
.PHONY: test-ci | ||
test-ci: ## Run the unit tests (used in the CI) | ||
./setup.sh | ||
./test.sh | ||
|
||
.PHONY: test-e2e | ||
test-e2e: ## Run the integration tests (used in the CI) | ||
./test_e2e_v1.sh | ||
./test_e2e_v2.sh | ||
./test_e2e.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,12 @@ K8S_VERSION=$1 | |
|
||
export GO111MODULE=on | ||
|
||
# setup go module to create the cluster | ||
go get sigs.k8s.io/[email protected] | ||
|
||
# You can use --image flag to specify the cluster version you want, e.g --image=kindest/node:v1.13.6, the supported version are listed at https://hub.docker.com/r/kindest/node/tags | ||
kind create cluster --config test/kind-config.yaml --image=kindest/node:$K8S_VERSION | ||
|
||
# setup the go modules required | ||
go get sigs.k8s.io/controller-tools/cmd/[email protected] | ||
go get sigs.k8s.io/kustomize/kustomize/[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.