Initial Commit.
Some checks failed
Home Cluster Builds/Image-Deploy-Arm64/pipeline/head There was a failure building this commit

This commit is contained in:
2023-01-11 23:40:09 +02:00
parent 3c72161a18
commit 3d5b4a7008
4 changed files with 8 additions and 31 deletions

47
cicd/Jenkinsfile vendored Normal file
View File

@@ -0,0 +1,47 @@
#!groovy
pipeline {
agent {
kubernetes {
defaultContainer 'jnlp'
yaml """
apiVersion: v1
kind: Pod
metadata:
name: deploy-arm64-image-build
spec:
serviceAccountName: jenkins-admin
nodeSelector:
kubernetes.io/arch: arm64
containers:
- name: kaniko
image: gcr.io/kaniko-project/executor:debug
command: ["tail"]
args: ["-f", "/dev/null"]
volumeMounts:
- name: kaniko-secret
mountPath: /kaniko/.docker
restartPolicy: Never
volumes:
- name: kaniko-secret
secret:
secretName: dockercred
items:
- key: .dockerconfigjson
path: config.json
"""
}
}
stages {
stage('Docker Build and Push') {
steps {
container("kaniko") {
sh 'destinationRegistry=`sed -n \'s/^destinationRegistry=\(.*\)/\1/p\' < config.conf`'
sh 'imageName=`sed -n \'s/^imageName=\(.*\)/\1/p\' < config.conf`'
sh 'imageTag=`sed -n \'s/^imageTag=\(.*\)/\1/p\' < config.conf`'
sh '/kaniko/executor --dockerfile `pwd`/Dockerfile --context `pwd` --destination ${destinationRegistry}/${imageName}:${imageTag}'
}
}
}
}
}