generated from Templates/Utility-Image-Builder
Bootstrap Commit.
All checks were successful
Home Cluster Builds/Image-Deploy-Amd64/pipeline/head This commit looks good
All checks were successful
Home Cluster Builds/Image-Deploy-Amd64/pipeline/head This commit looks good
This commit is contained in:
49
cicd/Jenkinsfile
vendored
Normal file
49
cicd/Jenkinsfile
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
#!groovy
|
||||
|
||||
pipeline {
|
||||
agent {
|
||||
kubernetes {
|
||||
defaultContainer 'jnlp'
|
||||
yaml """
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: deploy-amd64-image-build
|
||||
spec:
|
||||
serviceAccountName: jenkins-admin
|
||||
nodeSelector:
|
||||
kubernetes.io/arch: amd64
|
||||
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 '''
|
||||
export destinationRegistry=`sed -n 's/^destinationRegistry=\\(.*\\)/\\1/p' < config.conf`
|
||||
export imageName=`sed -n 's/^imageName=\\(.*\\)/\\1/p' < config.conf`
|
||||
export imageTag=`sed -n 's/^imageTag=\\(.*\\)/\\1/p' < config.conf`
|
||||
/kaniko/executor --dockerfile `pwd`/Dockerfile --context `pwd` --destination ${destinationRegistry}/${imageName}:${imageTag}
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user