-
Notifications
You must be signed in to change notification settings - Fork 6
/
Jenkinsfile
52 lines (52 loc) · 1.35 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
pipeline {
agent any
stages {
stage('Build and deploy PRRLA Code') {
steps {
awsCodeBuild(
projectName: "prrla-artifact-build",
credentialsId: "PRRLA-CodeBuild-Trigger-User",
region: "us-west-2",
credentialsType: "jenkins",
sourceControlType: "project",
sourceVersion: "master",
envVariables: "[ { APP_ENV, ${APP_ENV} } ]"
)
}
}
stage('Check site for errors') {
steps {
sh '''
if [[ ${APP_ENV} == "prl" ]]
then
if curl -s http://${APP_ENV}.library.ucla.edu | grep -i prrla
then
exit 0
else
exit 1
fi
else
if curl -s https://${APP_ENV}.library.ucla.edu | grep -i prrla
then
exit 0
else
exit 1
fi
fi
'''
}
}
}
post {
always {
// send build result notifications
slackSend (
channel: "#code_deployment",
color: "#FFFF00",
message: "${env.JOB_NAME} - #${env.BUILD_NUMBER} ${currentBuild.currentResult} after ${currentBuild.durationString.replace(' and counting', '')} (<${env.RUN_DISPLAY_URL}|open>)\nEnvironment: ${APP_ENV}.library.ucla.edu",
tokenCredentialId: "3f977f85-c455-4a52-9f84-e84122360849",
teamDomain: "uclalibrary"
)
}
}
}