Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save pratikt-cuelogic/865ffd94b8468e66a3e3a473f04a8399 to your computer and use it in GitHub Desktop.
Save pratikt-cuelogic/865ffd94b8468e66a3e3a473f04a8399 to your computer and use it in GitHub Desktop.
How tagname is being used to identify version and environment
var processTagName = function(tag_name) {
var result = false;
var tagSplit = tag_name.split('-');
var environments = {'dev':'D', 'stage':'S', 'prod':'P'};
if (tagSplit[0] && tagSplit[0].toLowerCase() !== 'kumo') {
environment = 'D';
}
var environment = environments[tagSplit[1] ? tagSplit[1].toLowerCase() : 'dev'] || 'D';
var version = tagSplit.slice(-1).pop();
return {'version':version, 'environment':environment};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment