-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run all CI commands inside the build container #209
## Change Overview * Performance improvements * Use simple travis VM since all commands are containerized * Use https://docs.travis-ci.com/user/caching/ * go mod source files * go build cache * Parallel jobs for docs and go tests * Add binaries to build image * kind, docker, jq * travis config simplificiations * uses start/stop-kind instead of directly invoking local_kube.sh * Makefile updates * Use tabs consistently * add go-mod-download * add release-snapshot ## Pull request type Please check the type of change your PR introduces: - [ ] Work in Progress - [ ] Refactoring (no functional changes, no api changes) - [ ] Trival/Minor - [ ] Bugfix - [x] Feature - [ ] Documentation
- Loading branch information
Showing
5 changed files
with
90 additions
and
75 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
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 |
---|---|---|
@@ -1,32 +1,36 @@ | ||
sudo: required | ||
services: | ||
- docker | ||
|
||
language: go | ||
services: | ||
- docker | ||
|
||
go: | ||
- "1.12.x" | ||
# Selecting C as the language keeps the container to a minimum footprint. All | ||
# go-specifc code is run in build container. | ||
language: c | ||
|
||
branches: | ||
only: | ||
- master | ||
|
||
# This moves Kubernetes specific config files. | ||
env: | ||
- CHANGE_MINIKUBE_NONE_USER=true GO111MODULE=on | ||
|
||
before_install: | ||
- wget --progress=dot:mega https://storage.googleapis.com/kubernetes-release/release/v1.15.0/bin/linux/amd64/kubectl | ||
- sudo chmod +x kubectl | ||
- sudo mv kubectl /usr/local/bin/kubectl | ||
|
||
script: | ||
- go mod download | ||
- sudo make build | ||
- make docs | ||
- docker run -ti --rm --net host -e GOPATH=/go -v ${GOPATH}:/go -v /var/run/docker.sock:/var/run/docker.sock -v ${HOME}/.kube:/root/.kube -v $(pwd):/data -w /data --entrypoint="bash" kanisterio/build:v0.0.1 -c "bash build/local_kubernetes.sh start_localkube" | ||
- sudo make test | ||
|
||
after_script: | ||
- docker run -ti --rm --net host -e GOPATH=/go -v ${GOPATH}:/go -v /var/run/docker.sock:/var/run/docker.sock -v ${HOME}/.kube:/root/.kube -v $(pwd):/data -w /data --entrypoint="bash" kanisterio/build:v0.0.1 -c "bash build/local_kubernetes.sh stop_localkube" | ||
cache: | ||
directories: | ||
- .go/pkg/mod/cache | ||
- .go/cache | ||
|
||
jobs: | ||
include: | ||
- stage: test | ||
script: | ||
- make docs | ||
- stage: test | ||
install: | ||
- make go-mod-download | ||
before_script: | ||
- make start-kind | ||
script: | ||
- make build | ||
- make test | ||
before_cache: | ||
- sudo chown -R travis:travis ./.go | ||
after_script: | ||
- make stop-kind | ||
|
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 |
---|---|---|
@@ -1,16 +1,20 @@ | ||
FROM golang:1.12.4-alpine3.9 | ||
FROM golang:1.12-alpine3.10 | ||
MAINTAINER Tom Manville <tom@kasten.io> | ||
|
||
RUN apk add --update --no-cache ca-certificates bash git \ | ||
&& update-ca-certificates \ | ||
&& rm -rf /var/cache/apk/* | ||
RUN apk add --update --no-cache ca-certificates bash git docker jq \ | ||
&& update-ca-certificates \ | ||
&& rm -rf /var/cache/apk/* | ||
|
||
COPY --from=bitnami/kubectl:1.13.4 /opt/bitnami/kubectl/bin/kubectl /usr/local/bin/ | ||
|
||
COPY --from=goreleaser/goreleaser:v0.112.2 /bin/goreleaser /usr/local/bin/ | ||
COPY --from=goreleaser/goreleaser:v0.115.0 /bin/goreleaser /usr/local/bin/ | ||
|
||
RUN wget -O /usr/local/bin/kind https://github.com/kubernetes-sigs/kind/releases/download/v0.4.0/kind-linux-amd64 \ | ||
&& chmod +x /usr/local/bin/kind | ||
|
||
ENV CGO_ENABLED=0 \ | ||
GO111MODULE="on" \ | ||
GOROOT="/usr/local/go" \ | ||
GOCACHE=/go/.cache/go-build \ | ||
GO_EXTLINK_ENABLED=0 \ | ||
PATH="/usr/local/go/bin:${PATH}" |