This repository has been archived by the owner on Mar 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
67 lines (57 loc) · 1.96 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
elifePipeline {
node('containers-jenkins-plugin') {
def commit
stage 'Checkout', { checkout scm
commit = elifeGitRevision()
}
stage 'Build images', {
checkout scm
// TODO: extract into dockerComposeBuild
def version
if (env.TAG_NAME) {
version = env.TAG_NAME - 'v'
} else {
version = ''
}
withEnv(["VERSION=${version}"]) {
dockerComposeBuild(commit)
}
}
stage 'Project tests', {
try {
sh "make IMAGE_TAG=${commit} NO_BUILD=y ci-test"
} finally {
sh "make ci-clean"
}
}
stage 'End-to-end tests', {
try {
sh "make IMAGE_TAG=${commit} NO_BUILD=y ci-end-to-end-test"
} finally {
sh "make ci-clean"
}
}
elifeMainlineOnly {
stage 'Merge to master', {
elifeGitMoveToBranch commit, 'master'
}
stage 'Push unstable image', {
def image = DockerImage.elifesciences(this, 'sciencebeam-pipelines', commit)
def unstable_image = image.addSuffixAndTag('_unstable', commit)
unstable_image.tag('latest').push()
unstable_image.push()
}
}
elifeTagOnly { tagName ->
def candidateVersion = tagName - "v"
stage 'Push release image', {
def image = DockerImage.elifesciences(this, 'sciencebeam-pipelines', commit)
image.tag('latest').push()
image.tag(candidateVersion).push()
}
stage 'Downstream', {
build job: '/dependencies/dependencies-sciencebeam-texture-update-sciencebeam-pipelines', wait: false, parameters: [string(name: 'tag', value: candidateVersion)]
}
}
}
}