-
Notifications
You must be signed in to change notification settings - Fork 3
/
Jenkinsfile
62 lines (45 loc) · 1.63 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
60
61
62
node() {
try {
// Variables
// *************************
println 'Read In:'
def applicationName = "carto"
def environmentName = "carto-prod-v1"
def applicationVersionLabel = "${applicationName}-${VERSION_NUMBER}-${currentBuild.number}"
println "applicationVersionLabel: ${applicationVersionLabel}"
println "environmentName: ${environmentName}"
// Stages
// *************************
stage ('Clean Workspace') {
deleteDir()
println 'Checking out tn-carto'
git url: "git@github.com:${GIT_REPO_TN_CARTO}/tn-carto.git", branch: "${GIT_COMMIT_TN_CARTO}"
}
stage('Prepare Beanstalk Archives') {
withEnv([
"APPLICATION_VERSION_LABEL=${applicationVersionLabel}"]) {
sh 'deploy/beanstalk_prepare.sh'
}
}
stage('Promote Application Versions') {
withEnv([
"APPLICATION_NAME=${applicationName}",
"APPLICATION_VERSION_LABEL=${applicationVersionLabel}"]) {
sh 'deploy/beanstalk_promote.sh'
}
}
stage('Deploy to Production') {
lock(resource: '${environmentName}') {
withEnv([
"APPLICATION_VERSION_LABEL=${applicationVersionLabel}",
"ENVIRONMENT_NAME=${environmentName}"]) {
sh 'deploy/beanstalk_deploy.sh'
}
}
}
} catch(err) {
currentBuild.result = 'FAILURE'
emailDefault('rex-tech@thinknear.com')
throw err
}
}