These days at work, I was asked if it was possible to do automated pipeline versioning.
After researching about I found some examples using date versioning, like:2021.21.09.153507
My sh that performs the versioning:
git pull --rebase origin dev
npm install -g json
year=$(date +'%Y')
month=$(date +'%m')
day=$(date +'%d')
hours=$(date +'%H')$(date +'%M')$(date +'%S')
newVersion="$year.$month.$day.$hours"
json -I -f package.json -e "this.version=\"$newVersion\""
git add package.json
git commit -m "[skip ci]"
git push origin dev
Everything worked out with this solution, but we always use versioning manual with the semantic like this: 1.0.0
Is it possible to identify which branch is being merged and thus create conditions to increase the version depending on some tag in the commit?