java-spring-microservice/Jenkinsfile
Jim Nicholson 21caf72285
Some checks failed
Homelab/java-spring-microservice/pipeline/head There was a failure building this commit
Correct registry
2021-12-23 10:45:26 -08:00

42 lines
1001 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:debug',
command: 'sleep',
args: '99d'
)
], workspaceVolume: dynamicPVC()) {
node(label) {
stage('Checkout') {
checkout scm
container('maven') {
stage('Build') {
sh '''
mvn clean package
'''
}
stage('Archive') {
archiveArtifacts artifacts: 'target/*.jar', followSymlinks: false
}
}
container('kaniko') {
stage('Image') {
sh '''
pwd
ls
/kaniko/executor -f `pwd`/Dockerfile -c `pwd` --insecure --skip-tls-verify --cache=true --destination=docker.home.thejimnicholson.com/servicedemo/test:latest
'''
}
}
}
}
}