Switched to node builder
This commit is contained in:
parent
f08f170750
commit
234247d123
47
Jenkinsfile
vendored
47
Jenkinsfile
vendored
@ -1,19 +1,34 @@
|
||||
node("docker-node") {
|
||||
docker.withRegistry('https://harbor.ervine.dev', 'jenkins-to-harbor') {
|
||||
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
|
||||
"""
|
||||
) {
|
||||
|
||||
git branch: "3.11.6", url: "ssh://git@git.ervine.org/jonny/x86_64-alpine-3.11", credentialsId: 'jenkins-to-git'
|
||||
|
||||
sh "git rev-parse HEAD > .git/commit-id"
|
||||
def commit_id = readFile('.git/commit-id').trim()
|
||||
println commit_id
|
||||
|
||||
stage "build"
|
||||
def app = docker.build "library/x86_64/alpine/alpine-3.11"
|
||||
|
||||
stage "publish"
|
||||
app.push("${env.BUILD_NUMBER}")
|
||||
app.push("latest")
|
||||
app.push("3.11.6")
|
||||
app.push("3.11")
|
||||
node(POD_LABEL) {
|
||||
stage('Build with Kaniko') {
|
||||
git 'https://git.ervine.org/jonny/x86_64-alpine-3.11.git', credentialsId: 'git-to-jenkins'
|
||||
container('kaniko') {
|
||||
sh '/kaniko/executor -f `pwd`/Dockerfile -c `pwd` --cache=true --destination=harbor.ervine.dev/library/x86_64/alpine:3.11.6 --destination=harbor.ervine.dev/library/x86_64/alpine:3.11'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user