Added utility functions

This commit is contained in:
2025-09-24 10:37:33 +02:00
commit 68f2668e6a
3 changed files with 24 additions and 0 deletions

22
vars/utils.groovy Normal file
View File

@@ -0,0 +1,22 @@
def mapBranchToEnv(branchName) {
def branchNameToEnv = [develop: 'dev', qa: 'qa', master: 'prod']
return branchNameToEnv[branchName]
}
def composeFileName(branchName) {
return 'livecarta_build/compose.' + mapBranchToEnv(branchName) + '.yaml'
}
def composeProjectName(branchName) {
return 'lc_' + mapBranchToEnv(branchName) + '_apps'
}
def imgTag(branchName) {
def tag = [develop: 'dev', qa: 'qa', master: 'prod', main: 'prod']
return tag[branchName]
}
def deploymentServer(branchName) {
def servers = [develop: 'livecarta-dev', qa: 'live-ci', master: 'livecarta-prod-web']
return servers[branchName]
}