Files
jenkins-casc/Jenkinsfile
T
matthias bfcac57759
kaniko-test/pipeline/head There was a failure building this commit
Jenkinsfile aktualisiert
2025-03-10 23:56:25 +00:00

60 lines
1.4 KiB
Groovy

pipeline {
agent {
kubernetes {
label 'kaniko'
yaml """
kind: Pod
metadata:
name: kaniko
spec:
containers:
- name: golang
image: golang:1.12
command:
- cat
tty: true
- name: kaniko
image: gcr.io/kaniko-project/executor:debug
imagePullPolicy: Always
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
"""
}
}
stages {
stage('Checkout') {
}
stage('Make Image') {
environment {
PATH = "/busybox:$PATH"
REGISTRY = 'harbor.hnrx.net' // Configure your own registry
REPOSITORY = 'homelab/jenkins-casc'
IMAGE = 'cat'
}
steps {
container(name: 'kaniko', shell: '/busybox/sh') {
ansiColor('xterm') {
sh '''#!/busybox/sh
/kaniko/executor -f `pwd`/Dockerfile.run -c `pwd` --cache=true --destination=${REGISTRY}/${REPOSITORY}/${IMAGE}
'''
}
}
}
}
}
}