Add Jenkinsfile
This commit is contained in:
parent
393f28d2bb
commit
e750285629
47
Jenkinsfile
vendored
Normal file
47
Jenkinsfile
vendored
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
pipeline {
|
||||||
|
agent {
|
||||||
|
kubernetes {
|
||||||
|
workspaceVolume persistentVolumeClaimWorkspaceVolume(claimName: 'jenkins-agents-pvc', readOnly: false)
|
||||||
|
yaml """
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Pod
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: jnlp
|
||||||
|
image: jenkins/inbound-agent:latest
|
||||||
|
volumeMounts:
|
||||||
|
- name: workspace-volume
|
||||||
|
mountPath: /home/jenkins/agent
|
||||||
|
- name: kaniko
|
||||||
|
image: gcr.io/kaniko-project/executor:debug
|
||||||
|
imagePullPolicy: Always
|
||||||
|
command:
|
||||||
|
- sleep
|
||||||
|
args:
|
||||||
|
- 1d
|
||||||
|
volumeMounts:
|
||||||
|
- name: kaniko-secret
|
||||||
|
mountPath: /kaniko/.docker/config.json
|
||||||
|
subPath: .dockerconfigjson
|
||||||
|
- name: workspace-volume
|
||||||
|
mountPath: /home/jenkins/agent
|
||||||
|
volumes:
|
||||||
|
- name: kaniko-secret
|
||||||
|
secret:
|
||||||
|
secretName: build-kubix-harbor-registry-credentials
|
||||||
|
- name: workspace-volume
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: jenkins-agents-pvc
|
||||||
|
"""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stages {
|
||||||
|
stage('Build and Push Image with Kaniko') {
|
||||||
|
steps {
|
||||||
|
container('kaniko') {
|
||||||
|
sh '/kaniko/executor --dockerfile=./Dockerfile --context=dir://. --destination=gitea.kubix.siatel.ro/siatel/subversion'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user