Skip to content

Commit

Permalink
Tweaks to CI (#964)
Browse files Browse the repository at this point in the history
Signed-off-by: John Schnake <[email protected]>
  • Loading branch information
johnSchnake authored Oct 15, 2019
1 parent 3d0a548 commit a16e3e4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
24 changes: 19 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,18 @@ jobs:
name: "Check README in sync"
command: ./scripts/ci/check_readme_in_sync.sh

build_and_publish:
github-release:
docker:
- image: circleci/golang:1.13.1
steps:
- checkout
- run: curl -sL https://git.io/goreleaser | bash

publish_images:
machine:
enabled: true
steps:
- checkout
- run:
name: "Build Sonobuoy to ensure version"
command: make build_sonobuoy && sudo mv ./sonobuoy /usr/local/bin
- run: ./scripts/ci/publish.sh

build_and_test:
Expand Down Expand Up @@ -74,11 +78,21 @@ workflows:
filters:
tags:
only: /^v.*/
- build_and_publish:
- publish_images:
requires:
- check_go_mod
- check_readme_sync
- build_and_test
filters:
branches:
only: master
tags:
only: /^v.*/
- github-release:
requires:
- publish_images
filters:
branches:
ignore: /.*/
tags:
only: /^v.*/
14 changes: 0 additions & 14 deletions scripts/ci/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,13 @@ if [ -z "$CIRCLECI" ]; then
echo "this script is intended to be run only on CircleCI" >&2
exit 1
fi
SONOBUOY_CLI="${SONOBUOY_CLI:-sonobuoy}"

function goreleaser() {
curl -sL https://git.io/goreleaser | bash
}

function image_push() {
echo ${DOCKERHUB_TOKEN} | docker login --username sonobuoybot --password-stdin
IMAGE_BRANCH="$CIRCLE_BRANCH" make container push
}

if [ ! -z "$CIRCLE_TAG" ]; then
if [ "$($SONOBUOY_CLI version --short)" != "$CIRCLE_TAG" ]; then
echo "sonobuoy version does not match tagged version!" >&2
echo "sonobuoy short version is $($SONOBUOY_CLI version --short)" >&2
echo "tag is $CIRCLE_TAG" >&2
echo "sonobuoy full version info is $($SONOBUOY_CLI version)" >&2
exit 1
fi

goreleaser --skip-validate
image_push
else
echo "CIRCLE_TAG not set, not running goreleaser"
Expand Down

0 comments on commit a16e3e4

Please sign in to comment.