From 34d4ebe926f0fa3ee3b67ea412d16499b1461068 Mon Sep 17 00:00:00 2001 From: The_Spider Date: Sun, 12 Jul 2020 16:44:37 -0500 Subject: [PATCH] moaves to new registry --- build-minecraft.jenkins | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/build-minecraft.jenkins b/build-minecraft.jenkins index b305f5f..f8f1e25 100644 --- a/build-minecraft.jenkins +++ b/build-minecraft.jenkins @@ -2,10 +2,11 @@ def nodeLabel = "${UUID.randomUUID().toString()}" // Kaniko Image -def kanikoImage = "gcr.io/kaniko-project/executor:debug" +def kanikoImage = "registry.test-chamber-13.lan:5000/nhyatt/kaniko:latest" +def repositoryCreds = "quay-repository-creds" // Repository Locations -def pushRepo = "registry.test-chamber-13.lan:5000" +def pushRepo = "registry.test-chamber-13.lan:5000/nhyatt" def pushImage = "minecraft" def pushTag = "latest" @@ -42,6 +43,28 @@ spec: // Set working directory def workspace = pwd() + stage ("Prepare Kaniko") { + container ("kaniko") { + withCredentials([usernameColonPassword( + credentialsId: repositoryCreds, + variable: "dCreds", + )]) { + def dockerJSON = """{ + "auths": { + "registry.test-chamber-13.lan:5000": { + "auth": "${dcreds.bytes.encodeBase64().toString()}" + } + } + }""" + sh """ + set +x + echo '${dockerJSON}' > /kaniko/.docker/config.json + set -x + """ + } + } + } + stage ("Pre-Build") { def dockerFile = """ FROM ${baseImage}:${baseImageTag} @@ -70,7 +93,7 @@ CMD cd data; java -Xms${memoryMin} -Xmx${memoryMax} -jar ../paper-mc.jar stage ("Build & Push") { container ("kaniko") { - sh "/kaniko/executor --cleanup --insecure --skip-tls-verify --context \"${workspace}\" -f \"${workspace}/Dockerfile\" --destination \"${pushRepo}/${pushImage}:${pushTag}\"" + sh "/kaniko/executor --cleanup --context \"${workspace}\" -f \"${workspace}/Dockerfile\" --destination \"${pushRepo}/${pushImage}:${pushTag}\"" } } }