Some checks failed
Homelab/java-spring-microservice/pipeline/head There was a failure building this commit
42 lines
997 B
Groovy
42 lines
997 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.thejimnicholson.com/servicedemo/test:latest'
|
|
'''
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|