diff --git a/Dockerfile b/Dockerfile index 6478188..5f3ce2e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,3 @@ -FROM jenkins/jenkins:2.333-alpine +FROM jenkins/jenkins:2.346-jdk11 COPY --chown=jenkins:jenkins plugins.txt /usr/share/jenkins/ref/plugins.txt RUN jenkins-plugin-cli --verbose -f /usr/share/jenkins/ref/plugins.txt -d /usr/share/jenkins/ref/plugins diff --git a/Jenkinsfile b/Jenkinsfile index f817a16..7b1a830 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,31 +1,44 @@ #!/usr/bin/env groovy POD_LABEL = "jenkins-builder-${UUID.randomUUID()}" -REGISTRY = '10.0.96.12/jenkins' +REGISTRY = 'docker.thejimnicholson.com/jenkins' + +podTemplate( + name: POD_LABEL, + namespace: 'jenkins', + podRetention: always + containers: [ + containerTemplate(name: 'kaniko', image: 'gcr.io/kaniko-project/executor:debug', command: 'sleep', args: '30d') + ], + volumes: [ + secretVolume: { mountPath: '/kaniko/.docker/config.json', secretName: 'regcred'} ], + workspaceVolume: dynamicPVC() +) { -podTemplate(label: POD_LABEL, containers: [ - containerTemplate( - name: 'kaniko', - image: 'gcr.io/kaniko-project/executor:debug', - command: 'sleep', - args: '30d' - ) -], workspaceVolume: dynamicPVC()) { node(POD_LABEL) { stage('Checkout') { checkout scm } - container('kaniko') { - stage('Image') { - ansiColor('xterm') { - sh "/kaniko/executor \ - -f `pwd`/Dockerfile \ - -c `pwd` \ - --insecure \ - --skip-tls-verify \ - --destination=${REGISTRY}/jenkins:2.333 \ - --destination=${REGISTRY}/jenkins:latest" - } - } - } } + } + +// { +// node(POD_LABEL) { +// stage('Checkout') { +// checkout scm +// } +// container('kaniko') { +// stage('Image') { +// ansiColor('xterm') { +// sh "/kaniko/executor \ +// -f `pwd`/Dockerfile \ +// -c `pwd` \ +// --insecure \ +// --skip-tls-verify \ +// --destination=${REGISTRY}/jenkins:2.346 \ +// --destination=${REGISTRY}/jenkins:latest" +// } +// } +// } +// } +// }