build: Setup private docker repository
@@ -125,22 +125,24 @@ def generate_docker_images() {
def docker_nodes = nodesByLabel label:docker_node_label
def tasks = [:]
- docker_nodes.each { node_value ->
- tasks << build_images(node_value)
+ DOCKER_IMAGES.each { id, image ->
+ tasks << build_image(image)
}
return tasks
}
-def build_images(node_value) {
- def taskname = "build/${node_value}/"
+def build_image(image) {
+ def taskname = "build/${image.id}/"
return [(taskname): {
stage(taskname) {
- node(node_value) {
+ node(docker_node_label) {
checkout scm
def uid = getUid()
def gid = getGid()
+ docker.withRegistry('https://hub.libelektra.org',
+ 'docker-hub-elektra-jenkins') {
DOCKER_IMAGES.each { id, image ->
- docker.build(
+ def i = docker.build(
image.id,"""\
--pull \
--build-arg JENKINS_GROUPID=${gid} \
@@ -148,6 +150,8 @@ def build_images(node_value) {
-f ${image.path}/${image.file} \
${image.path}"""
)
+ i.push()
+ }
}
}
}
@@ -446,6 +450,8 @@ def dockerize(test_name, image, cl) {
return [(test_name): {
stage(test_name) {
node(docker_node_label) {
+ docker.withRegistry('https://hub.libelektra.org',
+ 'docker-hub-elektra-jenkins') {
timeout(activity: true, time: 5, unit: 'MINUTES') {
def cpu_count = cpuCount()
withEnv(["MAKEFLAGS='-j${cpu_count+2} -l${cpu_count*2}'",
@@ -457,6 +463,7 @@ def dockerize(test_name, image, cl) {
}
}
}
+ }
}]
}
