[GIT] Tags for versioning and GitLab CI

German Gensetskiy
Go Wombat
Published in
1 min readDec 7, 2018

In one of my current projects, i decided to use versions for my stage environment. I found that way quite useful and therefore i would like to share it with you.

So in the current setup we have 3 environments:

  • development (for front-end developers and testing)
  • stage (for proper QA and demos)
  • production (for actual usage)

Development and production environments are automatically updated from the corresponding branches (dev and master).

deploy:dev:
stage: deploy
only:
- dev

But for staging — there are version tags. Commonly those tags are created from the dev branch and are automatically updated using GitLab CI. It supports regular expressions and I created a simple one for versions in format v(float) e.g. v1.3

deploy:stage:
stage: deploy
only:
- /^v[0-9]+\.[0-9]+$/

https://regex101.com/r/O08jjy/3 — here you can check examples and explanations of used regular expression.

Thanks for reading! Hope you’ll find it helpful.

Ignisor under support of Go Wombat Team

--

--