Files
java-maven-app/Jenkinsfile
2020-11-08 17:25:26 +01:00

51 lines
1.1 KiB
Groovy

#!/usr/bin/env groovy
library identifier: 'jenkins-shared-library@master', retriever: modernSCM(
[$class: 'GitSCMSource',
remote: 'https://gitlab.com/nanuchi/jenkins-shared-library.git',
credentials: 'gitlab-credentials'
]
)
def gv
pipeline {
agent any
tools {
maven 'Maven'
}
stages {
stage("init") {
steps {
script {
gv = load "script.groovy"
}
}
}
stage("build jar") {
steps {
script {
buildJar()
}
}
}
stage("build and push image") {
steps {
script {
buildImage 'nanajanashia/demo-app:jma-3.0'
dockerLogin()
dockerPush 'nanajanashia/demo-app:jma-3.0'
}
}
}
stage("deploy") {
steps {
script {
gv.deployApp()
}
}
}
}
}