Jenkinsfile aktualisiert
kaniko-test/pipeline/head This commit looks good

This commit is contained in:
2025-03-11 00:21:00 +00:00
parent 286b3a6d3a
commit 016e335f09
Vendored
+33 -54
View File
@@ -1,59 +1,38 @@
pipeline { pipeline {
agent { agent {
kubernetes { kubernetes {
label 'kaniko' yaml '''
yaml """ apiVersion: v1
kind: Pod kind: Pod
metadata: metadata:
name: kaniko labels:
spec: some-label: some-label-value
containers: spec:
- name: golang containers:
image: golang:1.12 - name: maven
command: image: maven:3.9.9-eclipse-temurin-17
- cat command:
tty: true - cat
- name: kaniko tty: true
image: gcr.io/kaniko-project/executor:debug - name: busybox
imagePullPolicy: Always image: busybox
command: command:
- /busybox/cat - cat
tty: true tty: true
volumeMounts: '''
- name: jenkins-docker-cfg retries 2
mountPath: /kaniko/.docker
volumes:
- name: jenkins-docker-cfg
projected:
sources:
- secret:
name: registry-credentials
items:
- key: .dockerconfigjson
path: config.json
"""
}
} }
stages { }
stages {
stage('Make Image') { stage('Run maven') {
environment { steps {
PATH = "/busybox:$PATH" container('maven') {
REGISTRY = 'harbor.hnrx.net' // Configure your own registry sh 'mvn -version'
REPOSITORY = 'homelab/jenkins-casc'
IMAGE = 'cat'
}
steps {
container(name: 'kaniko', shell: '/busybox/sh') {
ansiColor('xterm') {
sh '''#!/busybox/sh
ls
pwd
/kaniko/executor -f ./Dockerfile --cache=true --no-push}
'''
}
}
}
} }
container('busybox') {
sh '/bin/busybox'
}
}
} }
}
} }