forked from openshift/os
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile.oscontainer
43 lines (39 loc) · 1.38 KB
/
Jenkinsfile.oscontainer
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
def TIMER = "H/30 * * * *"
def NODE = "atomic-jslave-autobrew"
def DOCKER_IMG = "quay.io/cgwalters/coreos-assembler"
// Turns out the Jenkins docker stuff totally breaks with SELinux
def DOCKER_ARGS = "--privileged"
node(NODE) {
docker.image(DOCKER_IMG).pull()
checkout scm
utils = load("pipeline-utils.groovy")
utils.define_properties(TIMER)
stage("Prepare Dockerfile") {
docker.image(DOCKER_IMG).inside(DOCKER_ARGS) {
withCredentials([
string(credentialsId: params.OSTREE_INSTALL_URL, variable: 'OSTREE_INSTALL_URL'),
]) {
sh "sed -e 's,@OSTREE_REPO_URL@,${OSTREE_INSTALL_URL},' < Dockerfile.rollup.in > Dockerfile.rollup"
}
}
}
withCredentials([
string(credentialsId: params.REGISTRY, variable: 'REGISTRY'),
]) {
docker.withRegistry("${REGISTRY}", params.REGISTRY_CREDENTIALS) {
def img;
stage("Build container") {
img = docker.build("coreos/openshift-redhat-coreos:3.10", "-f Dockerfile.rollup .")
}
if (params.DRY_RUN) {
echo "DRY_RUN set, skipping push"
currentBuild.result = 'SUCCESS'
currentBuild.description = '(dry run)'
return
}
stage("Push container") {
img.push()
}
}
}
}