podTemplate(yaml: ''' apiVersion: v1 kind: Pod spec: volumes: - name: docker-socket emptyDir: {} - name: docker-local-certs configMap: name: docker-cert containers: - name: docker image: docker:19.03.1 command: - sleep args: - 99d volumeMounts: - 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 - name: docker-local-certs mountPath: /etc/docker/certs.d/docker.local - name: python image: docker.local/ci/python:latest imagePullPolicy: Always command: ["cat"] - name: helm image: docker.local/ci/helm:latest imagePullPolicy: Always env: - name: KUBECONFIG value: /home/jenkins/agent/workspace/gitea-bme_covidok-backend_master/ci/kube.config command: ["cat"] ''') { node(POD_LABEL) { stage('Git') { git url: 'https://gyulai.cloud/git/bme/covidok-backend.git', credentialsId: '1b1c30a0-590d-41d4-b775-bdb90e837bc8' container('docker') { stage('Build dev image') { sh 'docker build -f /home/jenkins/agent/workspace/gitea-bme_covidok-backend_master/CoviDok/Dockerfile.CI -t docker.local/bme/covidok:dev /home/jenkins/agent/workspace' } stage('Push dev image') sh 'docker push docker.local/bme/covidok:dev' } } container('helm') { stage('Helm lint'){ sh 'helm lint /home/jenkins/agent/workspace/gitea-bme_covidok-backend_master/helm/covidok' } stage('Install dev') { sh '/home/jenkins/agent/workspace/gitea-bme_covidok-backend_master/ci/helm_test.sh' } } container('python') { stage('API test'){ sh 'python3 -m pytest /home/jenkins/agent/workspace/gitea-bme_covidok-backend_master/ci/tests' } } container('docker') { stage('Push tested image'){ sh 'docker tag docker.local/bme/covidok:dev docker.local/bme/covidok:latest' sh 'docker push docker.local/bme/covidok:latest' } } container('helm'){ post{ always { sh '/home/jenkins/agent/workspace/gitea-bme_covidok-backend_master/ci/cleanup.sh' } } } archiveArtifacts artifacts: '/home/jenkins/agent/workspace/gitea-bme_covidok-backend_master/covidok*tgz', followSymlinks: false, onlyIfSuccessful: true } } }