-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJenkinsfile
44 lines (40 loc) · 1.23 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
#!groovy
node {
try {
// Checkout the proper revision into the workspace.
stage('checkout') {
checkout scm
}
// write dummy sensitive file
writeFile file: 'sensitive.properties', text: '''postgres.host=localhost
postgres.port=5432
postgres.database=ci
postgres.user=ci
postgres.password=none
'''
// Execute `cibuild` wrapped within a plugin that translates
// ANSI color codes to something that renders inside the Jenkins
// console.
stage('cibuild') {
wrap([$class: 'AnsiColorBuildWrapper']) {
sh './scripts/cibuild'
archiveArtifacts artifacts: 'build/libs/*.jar', fingerprint: true
}
}
withCredentials([usernamePassword(credentialsId: 'gitlab-deploy-token_nocom-http', passwordVariable: 'GITLAB_PASSWORD', usernameVariable: 'GITLAB_USER')]) {
stage('cipublish') {
wrap([$class: 'AnsiColorBuildWrapper']) {
sh './scripts/cipublish'
}
}
}
} catch (err) {
// Re-raise the exception so that the failure is propagated to
// Jenkins.
throw err
} finally {
// Pass or fail, ensure that the services and networks
// created by Docker Compose are torn down.
sh 'docker-compose -f docker-compose.ci.yml down -v'
}
}