moves to new registry

This commit is contained in:
Hyatt 2020-07-12 16:30:58 -05:00
parent 61277283f7
commit 741bd12426
Signed by: nhyatt
GPG Key ID: C50D0BBB5BC40BEA

View File

@ -1,4 +1,6 @@
def label = "${UUID.randomUUID().toString()}" def label = "${UUID.randomUUID().toString()}"
def kanikoImage = "registry.test-chamber-13.lan:5000/nhyatt/kaniko:latest"
def repositoryCreds = "quay-repository-creds"
def app_name = "dohserver" def app_name = "dohserver"
def dockerfile = """ def dockerfile = """
@ -50,7 +52,7 @@ spec:
containers: containers:
- name: kaniko - name: kaniko
imagePullPolicy: Always imagePullPolicy: Always
image: gcr.io/kaniko-project/executor:debug image: ${kanikoImage}
tty: true tty: true
command: command:
- /busybox/cat - /busybox/cat
@ -58,16 +60,33 @@ spec:
) { ) {
node (label) { node (label) {
def workspace = pwd() def workspace = pwd()
container('kaniko') {
stage('Build Container') { stage ("Prepare Kaniko") {
writeFile file: workspace + '/Dockerfile', text: dockerfile container ("kaniko") {
withCredentials([usernameColonPassword(
credentialsId: repositoryCreds,
variable: "dCreds",
)]) {
def dockerJSON = """{
"auths": {
"registry.test-chamber-13.lan:5000": {
"auth": "${dcreds.bytes.encodeBase64().toString()}"
}
}
}"""
sh """ sh """
/kaniko/executor \\ set +x
--insecure \\ echo '${dockerJSON}' > /kaniko/.docker/config.json
--skip-tls-verify \\ set -x
--context "${workspace}" \\ """
-f "${workspace}/Dockerfile" \\ }
--destination "registry.test-chamber-13.lan:5000/${app_name}:latest" }
}
stage('Build Container') {
container('kaniko') {
writeFile file: workspace + '/Dockerfile', text: dockerfile
sh "/kaniko/executor --context \"${workspace}\" -f \"${workspace}/Dockerfile\" --destination \"registry.test-chamber-13.lan:5000/nhyatt/${app_name}:latest\""
""" """
} }
} }