jenkins-container/Jenkinsfile
jim 01b1779d01
Some checks failed
Homelab/jenkins-container/pipeline/head There was a failure building this commit
Update 'Jenkinsfile'
2022-09-02 02:09:29 +00:00

62 lines
1.6 KiB
Groovy

#!/usr/bin/env groovy
POD_LABEL = "jenkins-builder-${UUID.randomUUID()}"
REGISTRY = 'registry.thejimnicholson.com/jenkins'
podTemplate(
label: POD_LABEL,
namespace: 'jenkins',
containers: [
containerTemplate(
name: 'kaniko',
image: 'gcr.io/kaniko-project/executor:debug',
command: 'sleep',
args: '30d'
)
],
volumes: [
secretVolume(mountPath: '/kaniko/.docker', secretName: 'registrypush')
],
workspaceVolume: dynamicPVC(),
{
node(POD_LABEL) {
stage('Checkout') {
checkout scm
}
container('kaniko') {
stage('Image') {
ansiColor('xterm') {
sh "/kaniko/executor \
-f `pwd`/Dockerfile \
-c `pwd` \
--insecure \
--skip-tls-verify \
--destination=${REGISTRY}/jenkins:2.346 \
--destination=${REGISTRY}/jenkins:latest"
}
}
}
}
}
)
// {
// node(POD_LABEL) {
// stage('Checkout') {
// checkout scm
// }
// container('kaniko') {
// stage('Image') {
// ansiColor('xterm') {
// sh "/kaniko/executor \
// -f `pwd`/Dockerfile \
// -c `pwd` \
// --insecure \
// --skip-tls-verify \
// --destination=${REGISTRY}/jenkins:2.346 \
// --destination=${REGISTRY}/jenkins:latest"
// }
// }
// }
// }
// }