diff --git a/.circleci/config.yml b/.circleci/config.yml index c258a56f0..f3b6b9b74 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,6 +16,11 @@ aliases: paths: - ~/go/pkg/mod - ~/.cache/go-build/ + only-version-tags: &only-version-tags + tags: + only: /^v[0-9].*/ + branches: + ignore: /.*/ default_environment: &default_environment SERVICE: circle-ci @@ -359,15 +364,23 @@ workflows: - build - docker-build - docker-push: + # Requires dockerhub credentials, from circleci context. + context: dockerhub requires: - - docker-build - - golint - - gotest - - sharness - - interop - - go-ipfs-api - - go-ipfs-http-client - - ipfs-webui + - docker-build + - golint + - gotest + - sharness + - interop + - go-ipfs-api + - go-ipfs-http-client + - ipfs-webui + filters: + branches: + only: + - master + - release + - feat/stabilize-dht # NOTE: CircleCI only builds tags if you explicitly filter for them. That # also means tag-based jobs can only depend on other tag-based jobs, so we @@ -376,16 +389,9 @@ workflows: docker-on-tag: jobs: - docker-build: - filters: - tags: - only: /^v[0-9].*|^cluster.+/ - branches: - ignore: /.*/ + filters: *only-version-tags - docker-push: + context: dockerhub + filters: *only-version-tags requires: - docker-build - filters: - tags: - only: /^v[0-9].*|^cluster.+/ - branches: - ignore: /.*/ diff --git a/bin/push-docker-tags.sh b/bin/push-docker-tags.sh index 39bc4cd7b..60fd03a04 100755 --- a/bin/push-docker-tags.sh +++ b/bin/push-docker-tags.sh @@ -61,9 +61,6 @@ pushTag () { if [[ $GIT_TAG =~ ^v[0-9]+ ]]; then pushTag "$GIT_TAG" -elif [[ $GIT_BRANCH =~ ^cluster ]]; then - pushTag "$GIT_BRANCH" - elif [ "$GIT_BRANCH" = "feat/stabilize-dht" ]; then pushTag "bifrost-${BUILD_NUM}-${GIT_SHA1_SHORT}" pushTag "bifrost-latest" @@ -73,6 +70,7 @@ elif [ "$GIT_BRANCH" = "release" ]; then pushTag "latest" elif [ "$GIT_BRANCH" = "master" ]; then + pushTag "master-${BUILD_NUM}-${GIT_SHA1_SHORT}" pushTag "master" else