-
Notifications
You must be signed in to change notification settings - Fork 20
/
Jenkinsfile
50 lines (46 loc) · 1.29 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
@Library('jenkins-pipeline') _
node {
// Wipe the workspace so we are building completely clean
cleanWs()
try {
dir('src') {
stage('checkout code') {
checkout scm
}
updateGithubCommitStatus('PENDING', "${env.WORKSPACE}/src")
uberjar()
stage('build deb package') {
gitPbuilder('xenial', false, '../build-area-xenial')
gitPbuilder('bionic', false, '../build-area-bionic')
}
}
stage('upload debian packages') {
aptlyBranchUpload('xenial', 'main', 'build-area-xenial/*.deb')
aptlyBranchUpload('bionic', 'main', 'build-area-bionic/*.deb')
}
}
catch (err) {
currentBuild.result = 'FAILURE'
updateGithubCommitStatus('FAILURE', "${env.WORKSPACE}/src")
throw err
}
finally {
if (currentBuild.result != 'FAILURE') {
updateGithubCommitStatus('SUCCESS', "${env.WORKSPACE}/src")
}
cleanWs cleanWhenFailure: false
}
}
def uberjar() {
stage('uberjar') {
docker.withRegistry("https://${EXOSCALE_DOCKER_REGISTRY}") {
def clojureContainer = docker.image("${EXOSCALE_DOCKER_REGISTRY}/exoscale/clojure:latest")
clojureContainer.pull()
clojureContainer.inside('-u root --net=host') {
sh 'lein clean'
sh 'lein test'
sh 'lein uberjar'
}
}
}
}