This commit is contained in:
Vendored
+50
-11
@@ -1,20 +1,59 @@
|
|||||||
pipeline {
|
pipeline {
|
||||||
stages {
|
|
||||||
stage('Buildo Roboto') {
|
|
||||||
agent {
|
agent {
|
||||||
kubernetes {
|
kubernetes {
|
||||||
defaultContainer 'kaniko'
|
label 'kaniko'
|
||||||
yamlFile 'kaniko.yaml'
|
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 {
|
steps {
|
||||||
/*
|
container(name: 'kaniko', shell: '/busybox/sh') {
|
||||||
* Since we're in a different pod than the rest of the
|
ansiColor('xterm') {
|
||||||
* stages, we'll need to grab our source tree since we don't
|
sh '''#!/busybox/sh
|
||||||
* have a shared workspace with the other pod(s)..
|
/kaniko/executor -f `pwd`/Dockerfile.run -c `pwd` --cache=true --destination=${REGISTRY}/${REPOSITORY}/${IMAGE}
|
||||||
*/
|
'''
|
||||||
checkout scm
|
}
|
||||||
sh 'sh -c ./scripts/build-kaniko.sh'
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user