Skip to content
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 docker hub publish step #42

Merged
merged 1 commit into from
Jul 20, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,24 @@ jobs:
command: |
ghr -t ${GHI_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} ${CIRCLE_TAG} ./artifacts/

publish-docker-release:
docker:
- image: circleci/buildpack-deps:stretch
steps:
- checkout
- setup_remote_docker
- attach_workspace:
at: ./artifacts
- run:
name: "Publish Release on Docker Hub"
command: |
docker_tag=$(echo ${CIRCLE_TAG} | cut -b2- )
docker build -t observiq/carbon:${docker_tag} .
docker login -u ${DOCKER_HUB_USER} -p ${DOCKER_HUB_TOKEN}
docker push observiq/carbon:${docker_tag}
docker tag observiq/carbon:${docker_tag} observiq/carbon:latest
docker push observiq/carbon:latest

test-linux:
executor: golang
resource_class: large
Expand Down Expand Up @@ -370,3 +388,11 @@ workflows:
ignore: /.*/
tags:
only: /^v\d+\.\d+\.\d+.*/
- publish-docker-release:
requires:
- build
filters:
branches:
ignore: /.*/
tags:
only: /^v\d+\.\d+\.\d+.*/