-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathJenkinsfile
39 lines (35 loc) · 1.14 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
elifePipeline {
def commit
DockerImage image
stage 'Checkout', {
checkout scm
commit = elifeGitRevision()
}
node('containers-jenkins-plugin') {
stage 'Build image', {
checkout scm
commit = elifeGitRevision()
commitShort = elifeGitRevision().substring(0, 8)
branch = sh(script: 'git rev-parse --abbrev-ref HEAD', returnStdout: true).trim()
timestamp = sh(script: 'date --utc +%Y%m%d.%H%M', returnStdout: true).trim()
dockerComposeBuild commit
}
stage 'Project tests', {
dockerProjectTests 'recommendations', commit
}
elifeMainlineOnly {
stage 'Push image', {
image = DockerImage.elifesciences(this, "recommendations", commit).push()
image.tag("${branch}-${commitShort}-${timestamp}").push()
}
}
}
elifeMainlineOnly {
stage 'Approval', {
elifeGitMoveToBranch commit, 'approved'
node('containers-jenkins-plugin') {
image.pull().tag('approved').push()
}
}
}
}