I am setting up a repository to automate the deployment of a web-app.
To manage the master branch releases i use tags in git to mark every release ex: 0.0.4
, 0.0.5
and so on..
I notices that docker hub recently updated their Auto-build system and introduced a regex match. What i am trying to do is to get a image built every time i push a new tag to the branch.
My issue is that when i set up a new auto build on tag and regex like
/^[0-9.]+$/
it doesn't get triggered to build? It works fine if i just set up a auto build on branch with the latest tag, then every time i push anything to the branch i get a new latest build.
I got a response for docker hub support that solved my issue:
All newly created automated build repos referencing BitBucket source will be able to have dynamic build triggers based on Git tags.
However, for existing automated build repos, created before 29th December 2015, there is a catch. In order for these existing repos to have tag-based dynamic build triggers, you would need to do either of the following:
The painful way: You will need to remove/delete your automated build repo on Docker Hub and set it up again.
The less painful way: Go to your BitBucket repo settings page (https://bitbucket.org///admin), click on the Services tab under Integration. You should see Docker Hub as one of services listed, likely with an entry that looks like this: POST https://registry.hub.docker.com/hooks/bitbucket. Copy the URL (https://registry.hub.docker.com/hooks/bitbucket) and then click on the Webhooks tab under Integration, then proceed to Add webhook. The title should be "Docker Hub", paste the copied URL in the URL field, tick the "Active" box, and select the "Repository push" option for Triggers. The final configuration should look like the attached screenshot. Last but not least, save the configuration. If you have done either of the above steps, your automated build repo on Docker Hub would trigger new builds when you push any tags to your BitBucket repo.
For GitHub I had to do the following
Log into hub.docker.com and navigate to the appropriate repo eg Fluentd - papertrail
Go to GitHub and navigate to the repo you want to build from
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