Switched to node builder

This commit is contained in:
Jonathan Ervine 2020-07-20 22:41:10 +08:00
parent fbb953a367
commit d8c0aed742
2 changed files with 33 additions and 17 deletions

View File

@ -1,4 +1,4 @@
FROM harbor.ervine.dev/library/x86_64/alpine/alpine-3.11 FROM harbor.ervine.dev/library/x86_64/alpine/alpine-3.12
MAINTAINER “Jonathan Ervine” <docker@ervine.org> MAINTAINER “Jonathan Ervine” <docker@ervine.org>
ENV GETIPLAYER_OUTPUT=/config GETIPLAYER_PROFILE=/config/.get_iplayer PUID=1000 PGID=100 PORT=1935 ENV GETIPLAYER_OUTPUT=/config GETIPLAYER_PROFILE=/config/.get_iplayer PUID=1000 PGID=100 PORT=1935

46
Jenkinsfile vendored
View File

@ -1,18 +1,34 @@
node("docker-node") { podTemplate(yaml: """
docker.withRegistry('https://harbor.ervine.dev', 'jenkins-to-harbor') { 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
"""
) {
git branch: "3.11.6", url: "ssh://git@git.ervine.org/jonny/x86_64-alpine-get_iplayer", credentialsId: 'jenkins-to-git' node(POD_LABEL) {
stage('Build with Kaniko') {
sh "git rev-parse HEAD > .git/commit-id" git url: 'ssh://git@git.ervine.org/jonny/x86_64-alpine-get_iplayer.git', credentialsId: 'jenkins-to-git'
def commit_id = readFile('.git/commit-id').trim() container('kaniko') {
println commit_id sh '/kaniko/executor -f `pwd`/Dockerfile -c `pwd` --cache=true --destination=harbor.ervine.dev/library/x86_64/alpine/get_iplayer:3.25'
}
stage "build" }
def app = docker.build "library/x86_64/alpine/get_iplayer"
stage "publish"
app.push("${env.BUILD_NUMBER}")
app.push("3.25")
app.push("latest")
} }
} }