Skip to content

Commit

Permalink
Run e2e tests before building a release
Browse files Browse the repository at this point in the history
  • Loading branch information
pwittrock committed Mar 15, 2018
1 parent e63c885 commit f62c182
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 1 deletion.
6 changes: 6 additions & 0 deletions build/cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ steps:
- 'GOOS=${_GOOS}'
- 'GOARCH=${_GOARCH}'
- 'VERSION=${TAG_NAME}'
- name: "ubuntu"
args: ["bash", "build/test.sh"]
env:
- 'GOOS=${_GOOS}'
- 'GOARCH=${_GOARCH}'
- 'VERSION=${TAG_NAME}'
- name: 'gcr.io/cloud-builders/gsutil'
args: ['-h', 'Content-Type:application/gzip', 'cp', 'kubebuilder-${TAG_NAME}-${_GOOS}-${_GOARCH}.tar.gz', 'gs://kubebuilder-release/kubebuilder-${TAG_NAME}-${_GOOS}-${_GOARCH}.tar.gz']
env:
Expand Down
6 changes: 6 additions & 0 deletions build/cloudbuild_local.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,11 @@ steps:
- 'GOOS=${_GOOS}'
- 'GOARCH=${_GOARCH}'
- 'VERSION=${TAG_NAME}'
- name: "ubuntu"
args: ["bash", "build/test.sh"]
env:
- 'GOOS=${_GOOS}'
- 'GOARCH=${_GOARCH}'
- 'VERSION=${TAG_NAME}'
- name: "ubuntu"
args: ["bash", "-c", "ls | grep -v tar.gz | xargs rm -rf"]
25 changes: 25 additions & 0 deletions build/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash

cp -r /workspace/_output/kubebuilder /tmp/kubebuilder/

export GOPATH=/tmp/go
mkdir -p $GOPATH/src/github.com/kubernetes-sigs/kubebuilder-test/
cd $GOPATH/src/github.com/kubernetes-sigs/kubebuilder-test/

# Setup env vars
export PATH=$PATH:/tmp/kubebuilder/bin/
export TEST_ASSET_KUBECTL=/tmp/kubebuilder/bin/kubectl
export TEST_ASSET_KUBE_APISERVER=/tmp/kubebuilder/bin/kube-apiserver
export TEST_ASSET_ETCD=/tmp/kubebuilder/bin/etcd

# Run the commands
kubebuilder init repo --domain sample.kubernetes.io
kubebuilder create resource --group insect --version v1beta1 --kind Bee
kubebuilder create resource --group insect --version v1beta1 --kind Wasp

# Verify the controller-manager builds and the tests pass
go install github.com/kubernetes-sigs/kubebuilder-test/cmd/controller-manager
go build ./cmd/...
go build ./pkg/...
go test ./cmd/...
go test ./pkg/...
2 changes: 1 addition & 1 deletion test/travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ cd $GOPATH/src/github.com/kubernetes-sigs/kubebuilder-test/
# Run the commands
/tmp/kubebuilder/bin/kubebuilder init repo --domain sample.kubernetes.io
/tmp/kubebuilder/bin/kubebuilder create resource --group insect --version v1beta1 --kind Bee
#/tmp/kubebuilder/bin/kubebuilder create resource --group insect --version v1beta1 --kind Wasp
/tmp/kubebuilder/bin/kubebuilder create resource --group insect --version v1beta1 --kind Wasp

export TEST_ASSET_KUBECTL=/tmp/kubebuilder/bin/kubectl
export TEST_ASSET_KUBE_APISERVER=/tmp/kubebuilder/bin/kube-apiserver
Expand Down

0 comments on commit f62c182

Please sign in to comment.