Skip to content

Instantly share code, notes, and snippets.

View pratikt-cuelogic's full-sized avatar

Pratik Tayade pratikt-cuelogic

View GitHub Profile
{"name":"tinytorch","version":"1.1","soe_scripts_groups":[{"id":"682a225231f53d91dd9d1e7b20de91d4","name":"Apache","supported_os":"Ubuntu","soe_scripts_attributes":{"0":{"id":"9aa2aabbd3e8ec3b23c3097e45cc4d5b","name":"Install Apache","script_type":"both","script_text":"echo 'install apache'"},"1":{"id":"8bc59225503526b584bc09707af89168","name":"update apache","script_type":"command","script_text":"echo 'update apache'"}}}]}
@pratikt-cuelogic
pratikt-cuelogic / processTagNameFromController.js
Created March 9, 2017 06:07
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};