Skip to content

Instantly share code, notes, and snippets.

@gustavomcarmo
Created June 27, 2018 13:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gustavomcarmo/332e40f4e81103b0d0dd5ad077f0e446 to your computer and use it in GitHub Desktop.
Save gustavomcarmo/332e40f4e81103b0d0dd5ad077f0e446 to your computer and use it in GitHub Desktop.
Script to set the TAG value for posterior using in Bamboo job. Assumes the TAG is not latest if follows the semantic versioning, starting with v.
#!/bin/bash
rx='^v([0-9]+\.){0,2}(\*|[0-9]+)$'
if [[ ${bamboo.planRepository.1.revision} =~ $rx ]]; then
TAG=${bamboo.planRepository.1.revision}
else
TAG=latest
fi
echo TAG=$TAG > properties.txt
cat properties.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment