forked from codice/saml-conformance
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTestJenkinsfile
49 lines (49 loc) · 1.85 KB
/
TestJenkinsfile
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
//"Jenkins Pipeline is a suite of plugins which supports implementing and integrating continuous delivery pipelines into Jenkins. Pipeline provides an extensible set of tools for modeling delivery pipelines "as code" via the Pipeline DSL."
//More information can be found on the Jenkins Documentation page https://jenkins.io/doc/
pipeline {
agent { label 'dind' }
options {
buildDiscarder(logRotator(numToKeepStr:'25'))
disableConcurrentBuilds()
timestamps()
}
triggers {
/*
Restrict nightly builds to master branch
Note: The BRANCH_NAME will only work with a multi-branch job using the github-branch-source
*/
cron(BRANCH_NAME == "master" ? "H H(17-19) * * *" : "")
}
environment {
PATH="${tool 'docker-latest'}/bin:$PATH"
}
stages {
stage('Setup') {
steps {
slackSend color: 'good', message: "STARTED: ${JOB_NAME} ${BUILD_NUMBER} ${BUILD_URL}"
sh 'docker-compose --file distribution/docker/docker-compose.yml pull'
}
}
stage('Run Tests') {
steps {
sh 'docker-compose --file distribution/docker/docker-compose.yml up --abort-on-container-exit'
}
post {
always {
sh 'docker-compose --file distribution/docker/docker-compose.yml down'
}
}
}
}
post {
success {
slackSend color: 'good', message: "SUCCESS: ${JOB_NAME} ${BUILD_NUMBER}"
}
failure {
slackSend color: '#ea0017', message: "FAILURE: ${JOB_NAME} ${BUILD_NUMBER}. See the results here: ${BUILD_URL}"
}
unstable {
slackSend color: '#ffb600', message: "UNSTABLE: ${JOB_NAME} ${BUILD_NUMBER}. See the results here: ${BUILD_URL}"
}
}
}