The changes in this PR take the deployment name, split the string on hyphens, takes the last 2 elements of the list from the split, joins them back into a string with hyphens separating them, and then truncates that to hold the last 20 chars.
Example:
deps = [
'couchbase-enterprise-edition-byol-1',
'couchbase-enterprise-edition-hourly-pricing-1',
'kinda-normal-name-with-hyphens',
'longdeploymentnamewithoutspacesjustbecause',
'this-is-really-long-with-dashes-and-stuff-to-break-but-not-today'
]
for i in range(0,5):
print 'Deployment is: ' + deps[i]
print 'Shortened : ' + '-'.join(deps[i].split('-')[-2:])[-20:]
Will give
Deployment is: couchbase-enterprise-edition-byol-1
Shortened : byol-1
Deployment is: couchbase-enterprise-edition-hourly-pricing-1
Shortened : pricing-1
Deployment is: kinda-normal-name-with-hyphens
Shortened : with-hyphens
Deployment is: longdeploymentnamewithoutspacesjustbecause
Shortened : outspacesjustbecause
Deployment is: this-is-really-long-with-dashes-and-stuff-to-break-but-not-today
Shortened : not-today
Update references to context.env['deployment']
The changes in this PR take the deployment name, split the string on hyphens, takes the last 2 elements of the list from the split, joins them back into a string with hyphens separating them, and then truncates that to hold the last 20 chars.
Example:
Will give