-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
55 lines (46 loc) · 1.6 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
pipeline {
agent any
environment {
DATABASE = "flyway_jenkins_demo"
PATH = "/usr/local/Cellar/postgresql/11.5_1/bin:/usr/local/Cellar/flyway/6.0.8/bin:$PATH"
}
stages {
stage('build') {
environment {
DEV = "dev"
}
steps {
//sh "printenv | sort"
//sh label: 'Build on Dev', script: "bash ./build.sh -db $DATABASE -env $DEV"
sh script: "./build.sh -d $DATABASE -e $DEV", label: 'Build on Dev'
}
}
stage('stg') {
environment {
STG = "stg"
}
steps {
//sh label: 'Deploy to Staging environment', script: "bash ./deploy_to_stg.sh -db $DATABASE -env $STG"
sh script: "./deploy_to_stg.sh -d $DATABASE -e $STG", label: 'Deploy to STG environment'
}
}
stage('qa') {
environment {
QA = "qa"
}
steps {
//sh label: 'Deploy to QA environment', script: "./deploy_to_qa.sh -db $DATABASE -env $QA"
sh script: "./deploy_to_qa.sh -d $DATABASE -e $QA", label: 'Deploy to QA environment'
}
}
stage('prd') {
environment {
PRD = "prd"
}
steps {
//sh label: 'Deploy to Production environment', script: "deploy_to_prd.sh -db $DATABASE -env $PRD"
sh script: "./deploy_to_prd.sh -d $DATABASE -e $PRD", label: 'Deploy to PRD environment'
}
}
}
}