From ade689a47d4a3bc5aa9324cfe2f3233ca3f42e9e Mon Sep 17 00:00:00 2001 From: The_Spider Date: Fri, 17 Jul 2020 13:41:41 -0500 Subject: [PATCH] registry changers --- build-alpine.jenkins | 8 ++++---- build-kaniko.jenkins | 6 +++--- build-minecraft.jenkins | 14 +++++--------- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/build-alpine.jenkins b/build-alpine.jenkins index fcb910e..a6f8c58 100644 --- a/build-alpine.jenkins +++ b/build-alpine.jenkins @@ -1,7 +1,7 @@ def label = "jenkins-${UUID.randomUUID().toString()}" -def repository = "registry.test-chamber-13.lan:8443/nhyatt" -def kanikoImage = "${repository}/kaniko:latest" +def repository = "registry.test-chamber-13.lan:8443" +def kanikoImage = "${repository}/nhyatt/kaniko:latest" def repositoryCreds = "quay-repository-creds" def caName = "test-chamber-13.lan.root.crt" @@ -51,7 +51,7 @@ spec: )]) { def dockerJSON = """{ "auths": { - "registry.test-chamber-13.lan:5000": { + "${repository}": { "auth": "${dcreds.bytes.encodeBase64().toString()}" } } @@ -75,7 +75,7 @@ RUN apk add --no-cache --virtual=.packagecache ca-certificates && \\ """ writeFile(file: workspace + "/" + caName, text: caContent) writeFile(file: workspace + "/Dockerfile", text: DF) - sh "/kaniko/executor --cleanup --context \"${workspace}\" -f \"${workspace}/Dockerfile\" --destination \"${repository}/alpine:latest\"" + sh "/kaniko/executor --cleanup --context \"${workspace}\" -f \"${workspace}/Dockerfile\" --destination \"${repository}/nhyatt/alpine:latest\"" } } } diff --git a/build-kaniko.jenkins b/build-kaniko.jenkins index 97884a0..742389b 100644 --- a/build-kaniko.jenkins +++ b/build-kaniko.jenkins @@ -1,6 +1,6 @@ def label = "jenkins-${UUID.randomUUID().toString()}" -def repository = "registry.test-chamber-13.lan:8443/nhyatt" +def repository = "registry.test-chamber-13.lan:8443" def repositoryCreds = "quay-repository-creds" def caContent = """ @@ -49,7 +49,7 @@ spec: )]) { def dockerJSON = """{ "auths": { - "registry.test-chamber-13.lan:5000": { + "${repository}": { "auth": "${dcreds.bytes.encodeBase64().toString()}" } } @@ -71,7 +71,7 @@ COPY kaniko-chain.crt /kaniko/ssl/certs/ca-certificates.crt """ sh "cp /kaniko/ssl/certs/ca-certificates.crt \"${workspace}/kaniko-chain.crt\"" writeFile(file: workspace + "/Dockerfile", text: DF) - sh "/kaniko/executor --cleanup --context \"${workspace}\" -f \"${workspace}/Dockerfile\" --destination \"${repository}/kaniko:latest\"" + sh "/kaniko/executor --cleanup --context \"${workspace}\" -f \"${workspace}/Dockerfile\" --destination \"${repository}/nhyatt/kaniko:latest\"" } } } diff --git a/build-minecraft.jenkins b/build-minecraft.jenkins index 3685b13..57517f0 100644 --- a/build-minecraft.jenkins +++ b/build-minecraft.jenkins @@ -2,16 +2,12 @@ def nodeLabel = "${UUID.randomUUID().toString()}" // Kaniko Image -def kanikoImage = "registry.test-chamber-13.lan:5000/nhyatt/kaniko:latest" +def repository = "registry.test-chamber-13.lan:8443" +def kanikoImage = "${repository}/nhyatt/kaniko:latest" def repositoryCreds = "quay-repository-creds" -// Repository Locations -def pushRepo = "registry.test-chamber-13.lan:5000/nhyatt" -def pushImage = "minecraft" -def pushTag = "latest" - // Container Variables -def baseImage = "${pushRepo}/alpine" +def baseImage = "${repository}/nhyatt/alpine" def baseImageTag = "latest" def alpineJavaPackage = "openjdk11" @@ -51,7 +47,7 @@ spec: )]) { def dockerJSON = """{ "auths": { - "registry.test-chamber-13.lan:5000": { + "${repository}": { "auth": "${dcreds.bytes.encodeBase64().toString()}" } } @@ -93,7 +89,7 @@ CMD cd data; java -Xms${memoryMin} -Xmx${memoryMax} -jar ../paper-mc.jar stage ("Build & Push") { container ("kaniko") { - sh "/kaniko/executor --cleanup --context \"${workspace}\" -f \"${workspace}/Dockerfile\" --destination \"${pushRepo}/${pushImage}:${pushTag}\"" + sh "/kaniko/executor --cleanup --context \"${workspace}\" -f \"${workspace}/Dockerfile\" --destination \"${repository}/nhyatt/minecraft:latest\"" } } }