Skip to content

Commit

Permalink
Merge pull request #492 from yue9944882/chore/faster-ci
Browse files Browse the repository at this point in the history
Chore: Faster Travis CI runs
  • Loading branch information
k8s-ci-robot committed Apr 3, 2020
2 parents 944c347 + c35f062 commit 18e9a63
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 24 deletions.
8 changes: 5 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,20 @@ 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

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:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
15 changes: 5 additions & 10 deletions example/basic/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 5 additions & 0 deletions example/basic/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down Expand Up @@ -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=
Expand Down Expand Up @@ -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=
Expand Down Expand Up @@ -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=
Expand Down Expand Up @@ -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=
Expand Down
2 changes: 2 additions & 0 deletions example/basic/install-kubebuilder.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/print-workspace-status.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)"

Expand Down
8 changes: 1 addition & 7 deletions test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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

Expand Down
2 changes: 2 additions & 0 deletions test/install-kubebuilder.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions test/travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 18e9a63

Please sign in to comment.