-
Notifications
You must be signed in to change notification settings - Fork 345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add image building/pushing back to Travis #835
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,33 @@ | ||
sudo: required | ||
language: go | ||
go: | ||
- "1.12" | ||
|
||
- '1.12' | ||
services: | ||
- docker | ||
|
||
- docker | ||
install: true | ||
|
||
script: | ||
- VERBOSE=true make test int | ||
- ./travis-ci.sh | ||
|
||
script: | ||
- export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi) | ||
- echo "TRAVIS_BRANCH=$TRAVIS_BRANCH, PR=$TRAVIS_PULL_REQUEST, BRANCH=$BRANCH" | ||
- VERBOSE=true make test int | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Most of these changes are due to the fact that the |
||
- ./travis-ci.sh | ||
before_install: | ||
# Download and install Kind | ||
- curl -L https://github.com/kubernetes-sigs/kind/releases/download/v0.4.0/kind-linux-amd64 --output kind && chmod +x kind | ||
- ./kind create cluster --config kind-config.yaml | ||
- export KUBECONFIG="$(./kind get kubeconfig-path --name="kind")" | ||
- curl -L https://github.com/golang/dep/releases/download/v0.5.3/dep-linux-amd64 --output dep && chmod +x dep | ||
|
||
- curl -L https://github.com/kubernetes-sigs/kind/releases/download/v0.4.0/kind-linux-amd64 | ||
--output kind && chmod +x kind | ||
- ./kind create cluster --config kind-config.yaml | ||
- export KUBECONFIG="$(./kind get kubeconfig-path --name="kind")" | ||
- curl -L https://github.com/golang/dep/releases/download/v0.5.3/dep-linux-amd64 --output | ||
dep && chmod +x dep | ||
before_deploy: | ||
# Install gcloud cli here so it gets cached | ||
- if [ ! -d ${HOME}/google-cloud-sdk ]; then | ||
curl https://sdk.cloud.google.com | bash /dev/stdin --disable-prompts; | ||
fi | ||
|
||
- if [ ! -d ${HOME}/google-cloud-sdk ]; then curl https://sdk.cloud.google.com | bash | ||
/dev/stdin --disable-prompts; fi | ||
deploy: | ||
- provider: script | ||
skip_cleanup: true | ||
script: ./travis-deploy.sh | ||
on: | ||
repo: heptio/sonobuoy | ||
all_branches: true | ||
|
||
- provider: script | ||
skip_cleanup: true | ||
script: ./travis-deploy.sh | ||
on: | ||
repo: heptio/sonobuoy | ||
all_branches: true | ||
env: | ||
secure: AsGb+4LLxBE9fo8eJMfuwUK3QTt61TC+HDP+GbzRaYPB27usaSouAvqeLJI2jxDU/oNaDlNarb3A43gZIqbZe+0uT8jdrqnv5pGmX4CooNm52zF4QEQrFpERvfFAdbUKkZ11NLXav3S0iLVb8/iWopF0/yvt7h0ohBzNX/tMs7vYeZ5KbKUF8v7Uwg3VmjIHsvfSmtaEvWPi3302O/lo5J1tB6TH8b/bAXWweU8GKmQnQKES/+tUern+zOT0S47/fyRbvG6KbLdttol9k7KbzWZxG2iHcC65ogmdHD2azZmLyL8s5khDkA2rO4ovnOqse2kxmxn7da7y8k93vWaN1y98RpXw4H6brsH15BzoGoYBaMLg/Kn/JbTkSxPkPr/+6WGJ6lFeGgvArkwCXVyRPpecSH55+kvKmD8wxGnXaQp086cNKBiZYgN4C+T/8XXO011CxgjzLCsyyqr2KGI7c1VXvdiDt+fjVUeE/ftbHFdHH8Oc809U+6sa+6UWFxDcg3fsyIDKqUAh+cOYdjL+8+OpNWiV8p7/Yu+QntbfMuRmkyQz9boYZU58uzFGe0B87nu0Y9O6nIKJWu07nPiPP11CU3iv2aYDfg2y1wvyvk5rWSgnBnD82nHf7ip2/bykbsajK2fcX1sIA/3c7NzWtKauxnfTXLxxqBRbZFkOuoE= | ||
|
||
after_success: | ||
- bash <(curl -s https://codecov.io/bash) | ||
- bash <(curl -s https://codecov.io/bash) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,8 +12,15 @@ function goreleaser() { | |
curl -sL https://git.io/goreleaser | bash | ||
} | ||
|
||
if [ ! -z "$TRAVIS_TAG" ]; then | ||
function gcr_push() { | ||
openssl aes-256-cbc -K $encrypted_222a2009ef6d_key -iv $encrypted_222a2009ef6d_iv -in heptio-images-c14f11347d8b.json.enc -out heptio-images-c14f11347d8b.json -d | ||
gcloud auth activate-service-account --key-file heptio-images-c14f11347d8b.json | ||
# https://github.com/travis-ci/travis-ci/issues/9905 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This issue was closed. Do we still need to do the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. /shrug I was just adding back the exact code that we previously had done this work. Let's just leave it (if it works) since this is all probably temporary anyways. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
That is a very good point. Ignore that comment then :) |
||
unset GIT_HTTP_USER_AGENT | ||
IMAGE_BRANCH="$BRANCH" DOCKER="gcloud docker -- " make container push | ||
} | ||
|
||
if [ ! -z "$TRAVIS_TAG" ]; then | ||
if [ "$(./sonobuoy version --short)" != "$TRAVIS_TAG" ]; then | ||
echo "sonobuoy version does not match tagged version!" >&2 | ||
echo "sonobuoy short version is $(./sonobuoy version --short)" >&2 | ||
|
@@ -23,4 +30,9 @@ if [ ! -z "$TRAVIS_TAG" ]; then | |
fi | ||
|
||
goreleaser --skip-validate | ||
gcr_push | ||
fi | ||
|
||
if [ "$BRANCH" == "master" ]; then | ||
gcr_push | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added these 2 for clarity; very unintuitive how
$TRAVIS_BRANCH
won't be the PRs branch. See the issues/article I linked to elsewhere on this PR.