From c35f06270dff1c1116eb4b53b759789d377b92a2 Mon Sep 17 00:00:00 2001 From: yue9944882 <291271447@qq.com> Date: Thu, 2 Apr 2020 13:56:26 +0800 Subject: [PATCH] faster ci runs --- .travis.yml | 8 +++++--- Makefile | 2 +- example/basic/Makefile | 15 +++++---------- example/basic/go.sum | 5 +++++ example/basic/install-kubebuilder.sh | 2 ++ scripts/print-workspace-status.sh | 2 +- test/Makefile | 8 +------- test/install-kubebuilder.sh | 2 ++ test/travis.sh | 4 ++-- 9 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2822dfaad6..af8a42eab8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,8 +7,8 @@ go_import_path: sigs.k8s.io/apiserver-builder-alpha cache: directories: - - $HOME/.glide - - /usr/local/kubebuilder/bin + - /usr/local/kubebuilder + - /home/travis/.cache/bazel git: depth: 3 @@ -16,9 +16,11 @@ git: before_install: - wget https://github.com/bazelbuild/bazel/releases/download/0.29.1/bazel_0.29.1-linux-x86_64.deb - sudo dpkg -i bazel_0.29.1-linux-x86_64.deb + - scripts/install_etcd.sh + - test/install-kubebuilder.sh install: - - scripts/install_etcd.sh + - make install jobs: include: diff --git a/Makefile b/Makefile index ec4a5e528f..3631ecc34e 100644 --- a/Makefile +++ b/Makefile @@ -61,7 +61,7 @@ clean: build: clean ## Create release artefacts for darwin:amd64, linux:amd64 and windows:amd64. Requires etcd, glide, hg. mkdir -p release/$(VERSION)/src bazel build --platforms=@io_bazel_rules_go//go/toolchain:$(GOOS)_$(GOARCH) cmd:apiserver-builder - tar xzf bazel-bin/vendor.tar.gz -C release/$(VERSION)/src + ls -lh bazel-bin/cmd cp bazel-bin/cmd/apiserver-builder.tar.gz apiserver-builder-alpha-$(VERSION)-$(GOOS)-$(GOARCH).tar.gz tar xzf apiserver-builder-alpha-$(VERSION)-$(GOOS)-$(GOARCH).tar.gz -C release/$(VERSION) diff --git a/example/basic/Makefile b/example/basic/Makefile index 8a64fabba1..5679883d05 100644 --- a/example/basic/Makefile +++ b/example/basic/Makefile @@ -23,24 +23,19 @@ test: build check check: go vet $$(go list ./... | grep -vE '(clientset|listers|informers)_generated') -build: cmds - bin/apiserver-boot build executables +build: + apiserver-boot build executables # Build docs docs: cleandocs build - bin/apiserver-boot build docs --server bin/apiserver + apiserver-boot build docs --server bin/apiserver -# Build the tools -# Note: These are available in the apiserver-builder release tar.gz -cmds: - ./install-kubebuilder.sh - ./build-tools.sh # Clean up functions clean: cleangenerated cleandocs cleangenerated: cmds - bin/apiserver-boot build generated clean + apiserver-boot build generated clean cleandocs: cmds - bin/apiserver-boot build docs clean + apiserver-boot build docs clean diff --git a/example/basic/go.sum b/example/basic/go.sum index 691bfd258e..0f8f8f639a 100644 --- a/example/basic/go.sum +++ b/example/basic/go.sum @@ -94,6 +94,7 @@ github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0 github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logr/logr v0.1.0 h1:M1Tv3VzNlEHg6uyACnRdtrploV2P7wZqH8BoQMtz0cg= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/zapr v0.1.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= github.com/go-logr/zapr v0.1.1/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= @@ -166,6 +167,7 @@ github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXP github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20181024230925-c65c006176ff/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef h1:veQD95Isof8w9/WXiA+pa3tz3fJXkt5B7QaRBrM62gk= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= @@ -493,6 +495,7 @@ golang.org/x/tools v0.0.0-20190920225731-5eefd052ad72/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gomodules.xyz/jsonpatch v2.0.0+incompatible/go.mod h1:JT8qjm2mBhTWRtbNy3nHq29aN05fIxGakDtQrGXlUAU= +gomodules.xyz/jsonpatch/v2 v2.0.1 h1:xyiBuvkD2g5n7cYzx6u2sxQvsAy4QJsZFCzGVdzOXZ0= gomodules.xyz/jsonpatch/v2 v2.0.1/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= @@ -520,6 +523,7 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/inf.v0 v0.9.0 h1:3zYtXIO92bvsdS3ggAdA8Gb4Azj0YU+TVY1uGYNFA8o= gopkg.in/inf.v0 v0.9.0/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= @@ -597,6 +601,7 @@ modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03 modernc.org/strutil v1.0.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs= modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I= sigs.k8s.io/controller-runtime v0.3.1-0.20191029211253-40070e2a1958/go.mod h1:p2vzQ3RuSVv9YR4AcM0y8TKHQA+0oLXazKFt6Z0OdS8= +sigs.k8s.io/controller-runtime v0.5.1 h1:TNidCfVoU/cs2i+9xoTcL/l7yhl0bDhYXU0NCG6wmiE= sigs.k8s.io/controller-runtime v0.5.1/go.mod h1:Uojny7gvg55YLQnEGnPzRE3dC4ik2tRlZJgOUCWXAV4= sigs.k8s.io/controller-tools v0.1.11-0.20190405182121-56d42b19e55a/go.mod h1:5B/NyJEvqwZNl6sJgTvQJGlxRK4TOJMdELRFDsUwSeY= sigs.k8s.io/controller-tools v0.1.12/go.mod h1:6g08p9m9G/So3sBc1AOQifHfhxH/mb6Sc4z0LMI8XMw= diff --git a/example/basic/install-kubebuilder.sh b/example/basic/install-kubebuilder.sh index 12d48dcebf..30a640fb55 100755 --- a/example/basic/install-kubebuilder.sh +++ b/example/basic/install-kubebuilder.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +[[ -f /usr/local/kubebuilder/bin/kubebuilder ]] && exit 0 + version=1.0.8 # latest stable version arch=amd64 os=linux diff --git a/scripts/print-workspace-status.sh b/scripts/print-workspace-status.sh index 5f84038a5d..9eab627e67 100755 --- a/scripts/print-workspace-status.sh +++ b/scripts/print-workspace-status.sh @@ -8,7 +8,7 @@ SCRIPT_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. VERSION_FILE=${SCRIPT_ROOT}/VERSION apiserver_builder_version=$(cat ${VERSION_FILE}) -k8s_vendor=kubernetes-1.16.0 +k8s_vendor=kubernetes-1.17.3 git_commit="$(git rev-parse HEAD)" build_date="$(date +%Y-%m-%d-%H:%M:%S)" diff --git a/test/Makefile b/test/Makefile index 0e866ca09f..5f740158d9 100644 --- a/test/Makefile +++ b/test/Makefile @@ -25,7 +25,7 @@ test: build check check: build go vet $$(go list ./... | grep -vE '(clientset|listers|informers)_generated') -skeleton: cmds +skeleton: apiserver-boot init repo --domain sample.kubernetes.io apiserver-boot create group version resource --group storage --version v1 --kind VolumeClaim $(NON_INTERACTIVE_FLAG) apiserver-boot create group version resource --group storage --version v1 --kind SnapshotClaim $(NON_INTERACTIVE_FLAG) @@ -39,12 +39,6 @@ build: cmds skeleton docs: cleandocs build apiserver-boot build docs --server bin/apiserver -# Build the tools -# Note: These are available in the apiserver-builder release tar.gz -cmds: - ./install-kubebuilder.sh - ./build-tools.sh - # Clean up functions clean: cleangenerated cleandocs diff --git a/test/install-kubebuilder.sh b/test/install-kubebuilder.sh index d60cbd27b0..746f5fa982 100755 --- a/test/install-kubebuilder.sh +++ b/test/install-kubebuilder.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +[[ -f /usr/local/kubebuilder/bin/kubebuilder ]] && exit 0 + version=1.0.8 # latest stable version arch=amd64 kubernetes_version=v1.15.0 diff --git a/test/travis.sh b/test/travis.sh index 6dbd71434e..b357868c47 100755 --- a/test/travis.sh +++ b/test/travis.sh @@ -4,8 +4,8 @@ set -x -e if [ "$TEST" == "example" ]; then cd example/basic - PATH=$PATH:/tmp/test-etcd make test + PATH=$GOPATH/bin:$PATH:/tmp/test-etcd make test elif [ "$TEST" == "test" ]; then cd test - PATH=$PATH:/tmp/test-etcd:`pwd`/bin/ make test + PATH=$GOPATH/bin:$PATH:/tmp/test-etcd make test fi