51 lines
1.1 KiB
Groovy
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',
|
|
credentialsId: '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()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|