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
+17 -38
View File
@@ -1,57 +1,36 @@
pipeline {
agent {
kubernetes {
label 'kaniko'
yaml """
yaml '''
apiVersion: v1
kind: Pod
metadata:
name: kaniko
labels:
some-label: some-label-value
spec:
containers:
- name: golang
image: golang:1.12
- name: maven
image: maven:3.9.9-eclipse-temurin-17
command:
- cat
tty: true
- name: kaniko
image: gcr.io/kaniko-project/executor:debug
imagePullPolicy: Always
- name: busybox
image: busybox
command:
- /busybox/cat
- 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('Make Image') {
environment {
PATH = "/busybox:$PATH"
REGISTRY = 'harbor.hnrx.net' // Configure your own registry
REPOSITORY = 'homelab/jenkins-casc'
IMAGE = 'cat'
}
stage('Run maven') {
steps {
container(name: 'kaniko', shell: '/busybox/sh') {
ansiColor('xterm') {
sh '''#!/busybox/sh
ls
pwd
/kaniko/executor -f ./Dockerfile --cache=true --no-push}
'''
}
container('maven') {
sh 'mvn -version'
}
container('busybox') {
sh '/bin/busybox'
}
}
}