Work on fixing versioning
Some checks failed
Homelab/java-spring-microservice/pipeline/head There was a failure building this commit

This commit is contained in:
Jim Nicholson 2021-12-23 14:00:50 -08:00
parent 544411b035
commit 7dffa57882
3 changed files with 26 additions and 4 deletions

8
.mvn/extensions.xml Normal file
View File

@ -0,0 +1,8 @@
<extensions xmlns="http://maven.apache.org/EXTENSIONS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/EXTENSIONS/1.0.0 http://maven.apache.org/xsd/core-extensions-1.0.0.xsd">
<extension>
<groupId>fr.brouillard.oss</groupId>
<artifactId>jgitver-maven-plugin</artifactId>
<version>1.9.0</version>
</extension>
</extensions>

20
Jenkinsfile vendored
View File

@ -1,5 +1,6 @@
def label = "mypod-${UUID.randomUUID().toString()}"
def label = "servicedemo-${UUID.randomUUID().toString()}"
podTemplate(label: label, containers: [
containerTemplate(
name: 'maven',
@ -17,6 +18,10 @@ podTemplate(label: label, containers: [
node(label) {
stage('Checkout') {
checkout scm
GIT_HASH = sh (
script: 'git rev-parse --short HEAD',
returnStdout: true
)
container('maven') {
stage('Build') {
sh '''
@ -30,9 +35,16 @@ podTemplate(label: label, containers: [
container('kaniko') {
stage('Image') {
ansiColor('xterm') {
sh '''
/kaniko/executor -f `pwd`/Dockerfile -c `pwd` --insecure --skip-tls-verify --cache=true --destination=docker.home.thejimnicholson.com/servicedemo/test:latest
'''
sh "
/kaniko/executor \
-f `pwd`/Dockerfile \
-c `pwd` \
--insecure \
--skip-tls-verify \
--cache=true \
--destination=docker.home.thejimnicholson.com/servicedemo/servicedemo:${GIT_HASH} \
--destination=docker.home.thejimnicholson.com/servicedemo/servicedemo:latest
"
}
}
}

View File

@ -74,6 +74,8 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>