forked from snd/mesa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
46 lines (39 loc) · 1.51 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
#!/usr/bin/env groovy
@Library('adscale')
import org.adscale.Utils
def utils = new Utils(this)
ansiColor('xterm') {
timestamps {
node('default') {
def branch = "${env.BRANCH_NAME}"
def buildUrl = "${env.BUILD_URL}"
stage('Checkout') {
deleteDir()
// Setup symlink ~/development/adscale -> WORKSPACE
// and set env var ADSCALE_DEV_ROOT=WORKSPACE
utils.resetDevelopmentAdscaleSymlink()
utils.gitClone(branch, 'mesa')
utils.dockerLoginToECR()
}
utils.stageIfNotFailing('Run CI') {
withEnv(['PATH+EXTRA=/home/jenkins/development/toolbox/bin', 'COMPOSE_FILE=docker-compose.yml']) {
timeout(15) {
catchError(buildResult: 'FAILURE', stageResult: 'UNSTABLE') {
sh 'docker-compose run app'
}
}
}
if (utils.jobIsFailing()) {
utils.slackSendMsg "`mesa` CI failed for branch `${branch}`. <${buildUrl}|See here for details>.", DANGER, "#labs-berlin-ops"
}
}
stage('Cleanup') {
withEnv(['PATH+EXTRA=/home/jenkins/development/toolbox/bin', 'COMPOSE_FILE=docker-compose.yml']) {
sh 'docker-compose down --volumes'
}
utils.flushDocker()
deleteDir()
}
}
}
}