Files
jenkins-casc/Jenkinsfile
T
matthias 8e867bc3d7
kaniko-test/pipeline/head This commit looks good
Jenkinsfile aktualisiert
2025-03-12 02:54:21 +00:00

49 lines
1.2 KiB
Groovy

pipeline {
agent {
kubernetes {
yaml '''
apiVersion: v1
kind: Pod
metadata:
labels:
some-label: some-label-value
spec:
containers:
- name: kaniko
image: gcr.io/kaniko-project/executor:debug
command: ["/busybox/cat"]
tty: true
volumeMounts:
- name: jenkins-docker-cfg
mountPath: /kaniko/.docker
volumes:
- name: jenkins-docker-cfg
projected:
sources:
- secret:
name: registry-credentials
items:
- key: .dockerconfigjson
path: config.json
'''
retries 2
}
}
stages {
stage('Run kaniko') {
environment {
PATH = "/busybox:$PATH"
}
steps {
container(name: 'kaniko', shell: '/busybox/sh') {
ansiColor('xterm') {
sh '''#!/busybox/sh
cat /kaniko/.docker/*
/kaniko/executor --dockerfile="Dockerfile" --context=`pwd` --destination=harbor.hnrx.net/homelab/my-jenkins-casc:test-build-$BUILD_ID
'''
}
}
}
}
}
}