test jenkins

This commit is contained in:
Fedor Katurov 2020-03-20 21:48:10 +07:00
parent b207cdd55c
commit 036dae321f

25
Jenkinsfile vendored
View file

@ -13,25 +13,27 @@ pipeline {
} }
stages { stages {
stage('CHECK') { stage('check') {
steps { steps {
echo "WWW: ${WWW}" echo "WWW: ${WWW}"
echo "ENV: ${ENV}" echo "ENV: ${ENV}"
echo "WORKSPACE: ${env.WORKSPACE},${WORKSPACE}"
sh 'pwd' sh 'pwd'
sh 'ls' sh 'ls'
script { script {
if("${WWW}" == "" || "${ENV}" == "" || ("${env.BRANCH_NAME}" != "master" && "${env.BRANCH_NAME}" != "develop")) { if("${WWW}" == "" || "${ENV}" == "" || ("${env.BRANCH_NAME}" != "master" && "${env.BRANCH_NAME}" != "dvelop")) {
println "INCORRECT VARIABLES" println "INCORRECT VARIABLES"
currentBuild.result = 'FAILED' currentBuild.result = 'FAILED'
failed = true failed = true
error "Build failed :-("
return return
} }
} }
} }
} }
stage('Copy ENV files') { stage('copy env') {
steps { steps {
sh "cp -a ${ENV}/. ./" sh "cp -a ${ENV}/. ./"
} }
@ -52,9 +54,9 @@ pipeline {
} }
} }
stage('Deploy: dev') { stage('deploy') {
when { when {
branch 'develop' // branch 'develop'
expression { expression {
!failed !failed
} }
@ -65,18 +67,5 @@ pipeline {
sh "mv ./dist ${WWW}" sh "mv ./dist ${WWW}"
} }
} }
stage('Deploy: master') {
when {
branch 'master'
expression {
!failed
}
}
steps{
echo "====== its a MASTER!!! ======"
}
}
} }
} }