dsteinkopf dsteinkopf - 1 year ago 125
Git Question

Circleci: Howto deploy depending on git tag

Is there a way to restrict circleci deployment on checkings that have a specific git tag?

Currently I am using this

branch: master
- docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
- docker push abcdef

Instead of
branch: master
I would like to write something like
tag: /release_.*/

Background: I would like set docker tags depending on git tags. So for example whenever something is committed to master, a new docker images with
tag will be created and pushed. Whenever a special git tag set (e.g.
) a new docker image with a tag
will be created and pushed.

Alternative is to only use different branches according to the different tags. But I would like to use tags to mark a specific release.

Answer Source

It looks like this was added since Kim answered.

Normally, pushing a tag will not run a build. If there is a deployment configuration with a tag property that matches the name of the tag you created, we will run the build and the deployment section that matches.

In the below example, pushing a tag named release-v1.05 would trigger a build & deployment. Pushing a tag qa-9502 would not trigger a build.

    tag: /release-.*/
    owner: circleci
      - ./deploy_master.sh
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download