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 {
stage('CHECK') {
stage('check') {
steps {
echo "WWW: ${WWW}"
echo "ENV: ${ENV}"
echo "WORKSPACE: ${env.WORKSPACE},${WORKSPACE}"
sh 'pwd'
sh 'ls'
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"
currentBuild.result = 'FAILED'
failed = true
error "Build failed :-("
return
}
}
}
}
stage('Copy ENV files') {
stage('copy env') {
steps {
sh "cp -a ${ENV}/. ./"
}
@ -52,9 +54,9 @@ pipeline {
}
}
stage('Deploy: dev') {
stage('deploy') {
when {
branch 'develop'
// branch 'develop'
expression {
!failed
}
@ -65,18 +67,5 @@ pipeline {
sh "mv ./dist ${WWW}"
}
}
stage('Deploy: master') {
when {
branch 'master'
expression {
!failed
}
}
steps{
echo "====== its a MASTER!!! ======"
}
}
}
}