Is there a way to restrict circleci deployment on checkings that have a specific git tag?
Currently I am using this
...
deployment:
dockerhub:
branch: master
commands:
- 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 to set docker tags depending on git tags. So for example, whenever something is committed to master, a new docker images with latest
tag will be created and pushed. Whenever a special git tag is set (e.g. release_1.0_2015-06-13
) a new docker image with a tag 1.0
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.
CircleCI automatically runs your build and test processes whenever you commit code, and then displays the build status in your GitHub branch.
Deployment job: To deploy your application, add a job to your . circleci/config. yml file and configure the job to run the steps you require. Visit the other pages in the deployment section of the documentation for example configurations for common deployment targets.
Go to https://github.com/you/test-repo/settings/keys , and click Add Deploy Key. Enter a title in the "Title" field, then copy and paste the public key you created in step 1. Check Allow write access, then click Add key. Go to your project settings in the CircleCI app, select SSH Keys, and Add SSH key.
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 tagqa-9502
would not trigger a build.deployment: release: tag: /release-.*/ owner: circleci commands: - ./deploy_master.sh
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With