java-spring-microservice/Jenkinsfile
Jim Nicholson c56e6b0349
Some checks failed
Homelab/java-spring-microservice/pipeline/head There was a failure building this commit
First cut at docker builds with kaniko
2021-12-22 17:35:23 -08:00

38 lines
881 B
Groovy

def label = "mypod-${UUID.randomUUID().toString()}"
podTemplate(label: label, containers: [
containerTemplate(
name: 'maven',
image: 'maven:3.8.4-openjdk-11',
command: 'sleep',
args: '30d'
),
containerTemplate(
name: 'kaniko',
image: 'gcr.io/kaniko-project/executor:latest',
command:
- sleep
args:
- 99d
)
]) {
node(label) {
stage('Checkout') {
checkout scm
container('maven') {
stage('Build') {
sh '''
mvn clean package
'''
}
stage('Archive') {
archiveArtifacts artifacts: 'target/*.jar', followSymlinks: false
}
}
container('kaniko') {
sh '/kaniko/executor -f `pwd`/Dockerfile -c `pwd` --insecure --skip-tls-verify --cache-true --destination=docker.thejimnicholson.com/servicedemo/test:latest'
}
}
}
}