Skip to content

Commit

Permalink
Publish snapshot docker containers
Browse files Browse the repository at this point in the history
  • Loading branch information
ungureanuvladvictor committed Sep 26, 2017
1 parent e04082d commit 9c2c850
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 9 deletions.
39 changes: 32 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ install-yarn: &install-yarn
apt-get -y update
apt-get -y install nodejs yarn
setup-docker: &setup-docker
run:
name: Setup Docker
commands: |
- setup_remote_docker
- *install-docker-client
version: 2
jobs:
build:
Expand Down Expand Up @@ -107,12 +114,21 @@ jobs:
- run: git log `git describe --tags --abbrev=0`..HEAD --pretty="### %s%n%b%n" > /tmp/artifacts/changelog.md
- *store-artifacts

publish:
publish-snapshot:
<<: *darwin-linux-no-cgo
steps:
- checkout
- setup_remote_docker
- *install-docker-client
- *setup-docker
- attach_workspace:
at: /go/src/github.com/palantir/bulldozer
- *build-docker-image
- run: ./scripts/publish_docker.sh

publish-release:
<<: *darwin-linux-no-cgo
steps:
- checkout
- *setup-docker
- run: ./godelw publish bintray --url https://api.bintray.com --subject palantir --repository releases --user "$BINTRAY_USERNAME" --password "$BINTRAY_PASSWORD" --publish --downloads-list bulldozer
- run: sha256sum dist/*.tgz
- attach_workspace:
Expand All @@ -128,19 +144,28 @@ workflows:
filters:
tags:
only: /.*/
- publish:
- changelog:
requires:
- build
filters:
tags:
only: /^[0-9]+(\.[0-9]+)+(-rc[0-9]+)?(-alpha[0-9]+)?$/
branches:
ignore: /.*/
- changelog:
branches:
only: /^master$/
- publish-snapshot:
requires:
- build
filters:
tags:
ignore: /.*/
branches:
only: /^master$/
- publish-release:
requires:
- build
filters:
tags:
only: /^[0-9]+(\.[0-9]+)+(-rc[0-9]+)?(-alpha[0-9]+)?$/
branches:
ignore: /.*/

10 changes: 8 additions & 2 deletions scripts/publish_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,11 @@
set -eu

docker login -u "${DOCKERHUB_USERNAME}" -p "${DOCKERHUB_PASSWORD}"
docker tag palantirtechnologies/bulldozer palantirtechnologies/bulldozer:$(./godelw project-version)
docker push palantirtechnologies/bulldozer

if git describe --exact-match --tags HEAD; then
docker tag palantirtechnologies/bulldozer palantirtechnologies/bulldozer:$(./godelw project-version)
docker push palantirtechnologies/bulldozer:$(./godelw project-version)
else
docker tag palantirtechnologies/bulldozer palantirtechnologies/bulldozer:snapshot
docker push palantirtechnologies/bulldozer:snapshot
fi

0 comments on commit 9c2c850

Please sign in to comment.