|
|
@ -1,30 +1,37 @@ |
|
|
|
podTemplate(yaml: """ |
|
|
|
apiVersion: v1 |
|
|
|
kind: Pod |
|
|
|
spec: |
|
|
|
volumes: |
|
|
|
- name: docker-socket |
|
|
|
emptyDir: {} |
|
|
|
containers: |
|
|
|
- name: kaniko |
|
|
|
image: gcr.io/kaniko-project/executor:debug |
|
|
|
imagePullPolicy: Always |
|
|
|
- name: docker |
|
|
|
image: docker:19.03.1 |
|
|
|
command: |
|
|
|
- /busybox/cat |
|
|
|
- sleep |
|
|
|
args: |
|
|
|
- 99d |
|
|
|
volumeMounts: |
|
|
|
- name: certs |
|
|
|
mountPath: /kaniko/ssl/certs |
|
|
|
tty: true |
|
|
|
volumes: |
|
|
|
- name: certs |
|
|
|
configMap: |
|
|
|
name: ca-certificates |
|
|
|
""" |
|
|
|
- name: docker-socket |
|
|
|
mountPath: /var/run |
|
|
|
- name: docker-daemon |
|
|
|
image: docker:19.03.1-dind |
|
|
|
securityContext: |
|
|
|
privileged: true |
|
|
|
volumeMounts: |
|
|
|
- name: docker-socket |
|
|
|
mountPath: /var/run |
|
|
|
''' |
|
|
|
) { |
|
|
|
|
|
|
|
node(POD_LABEL) { |
|
|
|
stage('Git') { |
|
|
|
git url: 'https://gyulai.cloud/git/bme/covidok-backend.git', |
|
|
|
credentialsId: '1b1c30a0-590d-41d4-b775-bdb90e837bc8' |
|
|
|
container('kaniko') { |
|
|
|
container('docker') { |
|
|
|
stage('Build and publish dev Docker image') { |
|
|
|
sh '/kaniko/executor --dockerfile=/home/jenkins/agent/workspace/gitea-bme_covidok-backend_master/CoviDok/Dockerfile.CI -c /home/jenkins/agent/workspace --destination=docker.local/bme/covidok' |
|
|
|
sh 'docker build -f /home/jenkins/agent/workspace/gitea-bme_covidok-backend_master/CoviDok/Dockerfile.CI -t docker.local/bme/covidok:latest /home/jenkins/agent/workspace && docker push docker.local/bme/covidok' |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|