Auto increment tags in builds?

Hi guys,

I wonder if anyone has an idea how I can auto increment tags when drone picks up the git changes?

I am used to using this when building images but now looking for an alternative solution now that I am embracing drone:

This basically creates a hidden file and increments this by one on each change/push. This also builds the image and pushes both tags. Now I don’t want to reinvent the wheel as your plugins/docker image works perfectly, however, I can’t think how I could adjust it so that the tagline doesn’t need to be manually updated which defeats the object of automation imo.

tags: [ latest, 1.1.0, 1.1, 1 ]

Is there a way I can read in a var or something instead of hard encoding the tags directly into the file? or does anyone have a better solution/idea?

Kind Regards,


I recommend this, pantheon-systems/autotag.

Hi @magicalbanana, thanks very much for this. I will have a play around tonight.

Kind Regards.

Have you taken a look at the auto_tag option in plugins/docker?

If you are looking to tag every push, then I recommend you use the ${DRONE_COMMIT} env var as a tag.