Update Jenkinsfile
This commit is contained in:
33
Jenkinsfile
vendored
33
Jenkinsfile
vendored
@@ -1,39 +1,44 @@
|
|||||||
|
def gv
|
||||||
|
|
||||||
pipeline {
|
pipeline {
|
||||||
|
|
||||||
agent any
|
agent any
|
||||||
|
|
||||||
parameters {
|
parameters {
|
||||||
choice(name: 'VERSION', choices: ['1.1.0', '1.2.0', '1.3.0'], description: '')
|
choice(name: 'VERSION', choices: ['1.1.0', '1.2.0', '1.3.0'], description: '')
|
||||||
booleanParam(name: 'executeTests', defaultValue: true, description: '')
|
booleanParam(name: 'executeTests', defaultValue: true, description: '')
|
||||||
}
|
}
|
||||||
stages {
|
stages {
|
||||||
|
stage("init") {
|
||||||
stage("build") {
|
|
||||||
|
|
||||||
steps {
|
steps {
|
||||||
echo 'building the application...'
|
script {
|
||||||
|
gv = load "script.groovy"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage("build") {
|
||||||
|
steps {
|
||||||
|
script {
|
||||||
|
gv.buildApp()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage("test") {
|
stage("test") {
|
||||||
|
|
||||||
when {
|
when {
|
||||||
expression {
|
expression {
|
||||||
params.executeTests
|
params.executeTests
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
echo 'testing the application...'
|
script {
|
||||||
|
gv.testApp()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage("deploy") {
|
stage("deploy") {
|
||||||
|
|
||||||
steps {
|
steps {
|
||||||
echo 'deplying the application...'
|
script {
|
||||||
echo "deploying version ${params.VERSION}"
|
gv.deployApp()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user