feature/DO-1628_CICD_msg_test (!84)
Reviewed-on: https://git.avroid.tech/DevOps/jenkins-pipelines/pulls/84 Reviewed-by: Rustam Tagaev <rustam.tagaev@avroid.team> Reviewed-by: Denis Patrakeev <denis.patrakeev@avroid.team>
This commit is contained in:
@@ -14,13 +14,18 @@ properties([
|
||||
Git git = new Git(this, env.JENKINS_GIT_CREDENTIALS_SSH)
|
||||
|
||||
String repoPath = 'Apps-Backend/msg-messenger-core-api.git'
|
||||
String publishBranch = 'develop'
|
||||
|
||||
Map envBranch = [
|
||||
'DEV': 'develop',
|
||||
'TEST': 'test'
|
||||
]
|
||||
String dockerGroup = 'cloud'
|
||||
String dockerProject = 'msg-messenger-core-api'
|
||||
String projectSettingFile = 'pyproject.toml'
|
||||
Map gitVars = [:]
|
||||
String tag = ''
|
||||
String branch = git.getBranch()
|
||||
String publishBranch = envBranch.find { it.value == branch }?.value
|
||||
|
||||
Map configuration = [
|
||||
vaultUrl: env.JENKINS_VAULT_URL,
|
||||
@@ -74,17 +79,17 @@ slaveTemplates.jnlp {
|
||||
"--build-arg PIP_INDEX_URL=${env.JENKINS_PIP_INDEX_URL} -f Dockerfile ."
|
||||
)
|
||||
|
||||
if (branch == publishBranch) {
|
||||
if (publishBranch.contains(branch)) {
|
||||
buildImage.push()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('deploy application'){
|
||||
if (branch == publishBranch){
|
||||
if (publishBranch.contains(branch)){
|
||||
build job: 'Cloud/Deploy/Backend/msg-messenger-core-api-deploy',
|
||||
parameters: [
|
||||
string(name: 'ENV', value: 'DEV'),
|
||||
string(name: 'ENV', value: envBranch.find { it.value == branch }?.key ),
|
||||
string(name: 'APP_VERSION', value: tag)
|
||||
],
|
||||
wait: false
|
||||
|
||||
Reference in New Issue
Block a user