diff --git a/Dockerfile b/Dockerfile index 0fc5e03..b63f916 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,7 +11,7 @@ ENV LANG='en_US.UTF-8' \ RUN echo http://dl-4.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories && \ apk update && \ - apk -U upgrade && \ + apk -U upgrade --ignore alpine-baselayout && \ apk -U add python3 git py-setuptools ADD UTC /etc/localtime diff --git a/Jenkinsfile b/Jenkinsfile index 0ebe4ac..fe2411a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,28 +1,34 @@ -node("docker-node") { - docker.withRegistry('https://harbor.ervine.dev', 'jenkins-to-harbor') { - - git branch: "master", url: "ssh://git@git.ervine.org/jonny/x86_64-alpine-tautulli", credentialsId: 'jenkins-to-git' - - sh "git rev-parse HEAD > .git/commit-id" - def commit_id = readFile('.git/commit-id').trim() - println commit_id - - try { - stage "build" - def app = docker.build "library/x86_64/alpine/tautulli" - - stage "publish" - app.push("${env.BUILD_NUMBER}") - app.push("latest") - app.push("2.5.3") - app.push("2.5") - - stage('Deploy on k8s'){ - sh "/usr/local/bin/kubectl -n media delete po tautulli-0" - } - } - catch (err) { - currentBuild.result = 'FAILURE' - } +podTemplate(yaml: """ +kind: Pod +spec: + containers: + - name: kaniko + image: gcr.io/kaniko-project/executor:debug-539ddefcae3fd6b411a95982a830d987f4214251 + imagePullPolicy: Always + command: + - /busybox/cat + tty: true + volumeMounts: + - name: jenkins-docker-cfg + mountPath: /kaniko/.docker + volumes: + - name: jenkins-docker-cfg + projected: + sources: + - secret: + name: regcred + items: + - key: .dockerconfigjson + path: config.json +""" + ) { + + node(POD_LABEL) { + stage('Build with Kaniko') { + git url: 'ssh://git@git.ervine.org/jonny/x86_64-alpine-tautulli.git', credentialsId: 'jenkins-to-git' + container('kaniko') { + sh '/kaniko/executor -f `pwd`/Dockerfile -c `pwd` --cache=true --destination=harbor.ervine.dev/library/x86_64/alpine/tautulli:2.5.3 --destination=harbor.ervine.dev/library/x86_64/alpine/tautulli:2.5' + } } + } }