-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
59 lines (54 loc) · 2.73 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
pipeline {
agent any
// environment {
// PROJECT = "Devops Curso"
// }
stages {
stage('Select Version'){
steps{
script{
switch(GIT_BRANCH) {
case "develop":
env.BUILD_VERSION = "1.0.${BUILD_NUMBER}-dev"
env.DEPLOY_ENV = "Development"
env.CREATE_RELEASE = false
break
case "release":
env.BUILD_VERSION = "1.0.${BUILD_NUMBER}-uat"
env.DEPLOY_ENV = "UAT"
env.CREATE_RELEASE = false
break
case "master":
env.BUILD_VERSION = "1.0.${BUILD_NUMBER}-master"
env.DEPLOY_ENV = "Production"
env.CREATE_RELEASE = true
break
default:
env.BUILD_VERSION = ""
env.DEPLOY_ENV = ""
env.CREATE_RELEASE = false
}
println(env.BUILD_VERSION)
println(env.DEPLOY_ENV)
println( env.CREATE_RELEASE)
}
}
}
stage ('Inicia Construccion segun check-in') {
parallel {
stage('Inicia Devops Microservicio'){
when { changeset '**/MicroService/**' }
steps {
build job: "CursoDevOps/CI-ServiceNet60-DEVMultiBranch/${env.BRANCH_NAME}", propagate: true, wait: true, parameters: [[$class: 'StringParameterValue', name: 'ParentBuildVersion', value: String.valueOf(BUILD_VERSION)], [$class: 'StringParameterValue', name: 'ParentBuildNumber', value: String.valueOf(BUILD_NUMBER)], [$class: 'StringParameterValue', name: 'DEPLOY_ENV', value: String.valueOf(env.DEPLOY_ENV)]]
}
}
stage('Inicia Devops MFE'){
when { changeset '**/MFE/**' }
steps {
build job: "CursoDevOps/CI-ServiceNet60-FrontEnd/${env.BRANCH_NAME}", propagate: true, wait: true, parameters: [[$class: 'StringParameterValue', name: 'ParentBuildVersion', value: String.valueOf(BUILD_VERSION)], [$class: 'StringParameterValue', name: 'ParentBuildNumber', value: String.valueOf(BUILD_NUMBER)], [$class: 'StringParameterValue', name: 'DEPLOY_ENV', value: String.valueOf(env.DEPLOY_ENV)]]
}
}
}
}
}
}