forked from cytomine/Cytomine-software-router
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJenkinsfile
executable file
·32 lines (27 loc) · 960 Bytes
/
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
node {
stage 'Retrieve sources'
checkout([
$class: 'GitSCM', branches: [[name: 'refs/heads/'+env.BRANCH_NAME]],
extensions: [[$class: 'CloneOption', noTags: false, shallow: false, depth: 0, reference: '']],
userRemoteConfigs: scm.userRemoteConfigs,
])
stage 'Clean'
sh 'rm -rf ./ci'
sh 'mkdir -p ./ci'
stage 'Compute version name'
sh 'scripts/ciBuildVersion.sh ${BRANCH_NAME}'
stage 'Download dependencies'
sh 'scripts/ciDownloadDependencies.sh'
stage 'Build jar'
sh 'scripts/ciBuildJar.sh'
stage 'Build docker image'
withCredentials(
[
usernamePassword(credentialsId: 'DOCKERHUB_CREDENTIAL', usernameVariable: 'DOCKERHUB_USER', passwordVariable: 'DOCKERHUB_TOKEN')
]
) {
docker.withRegistry('https://index.docker.io/v1/', 'DOCKERHUB_CREDENTIAL') {
sh 'scripts/ciBuildDockerImage.sh'
}
}
}