Browse Source

Added Jenkins pipeline

master
Daniel Gyulai 4 years ago
parent
commit
043fd6ba39
  1. 27
      Jenkinsfile

27
Jenkinsfile

@ -1,30 +1,17 @@
podTemplate(containers: [
containerTemplate(name: 'maven', image: 'maven:3.3.9-jdk-8-alpine', ttyEnabled: true, command: 'cat'),
containerTemplate(name: 'golang', image: 'golang:1.8.0', ttyEnabled: true, command: 'cat')
containerTemplate(name: 'golang', image: 'golang:1.8.0', ttyEnabled: true, command: 'cat'),
containerTemplate(name: 'kaniko', image: 'gcr.io/kaniko-project/executor:latest', imagePullPolicy: 'Always', command: '/busybox/cat', ttyEnabled: true)
]) {
node(POD_LABEL) {
stage('Get a Maven project') {
git 'https://github.com/jenkinsci/kubernetes-plugin.git'
container('maven') {
stage('Build a Maven project') {
sh 'mvn -B clean install'
stage('Build') {
git 'https://gyulai.cloud/git/bme/covidok-backend.git'
container('kaniko') {
stage('Build and publish dev Docker image') {
sh '/kaniko/executor -f covidok-backend/CoviDok/Dockerfile -c `pwd` --destination=docker.local/bme/covidok'
}
}
}
stage('Get a Golang project') {
git url: 'https://github.com/hashicorp/terraform.git'
container('golang') {
stage('Build a Go project') {
sh """
mkdir -p /go/src/github.com/hashicorp
ln -s `pwd` /go/src/github.com/hashicorp/terraform
cd /go/src/github.com/hashicorp/terraform && make core-dev
"""
}
}
}
}
}
Loading…
Cancel
Save