1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 04:46:40 +07:00

fixed jenkins for PRs

This commit is contained in:
Fedor Katurov 2020-04-20 10:16:12 +07:00
parent 201b55d463
commit 88a22b4889

24
Jenkinsfile vendored
View file

@ -7,20 +7,14 @@ pipeline {
} }
stages { stages {
stage('check') { stage('') {
steps { steps {
echo "WWW: ${WWW}" echo "WWW: ${WWW}\nENV: ${ENV}\n"
echo "ENV: ${ENV}"
echo "WORKSPACE: ${WORKSPACE}"
sh 'pwd'
sh 'ls'
script { script {
if("${WWW}" == "" || "${ENV}" == "" || ("${env.BRANCH_NAME}" != "master" && "${env.BRANCH_NAME}" != "develop")) { if("${WWW}" == "" || "${ENV}" == "" {
println "INCORRECT VARIABLES"
currentBuild.result = 'FAILED' currentBuild.result = 'FAILED'
failed = true error "No valid deploy dirs"
error "Build failed :-("
return return
} }
} }
@ -33,14 +27,18 @@ pipeline {
} }
} }
stage('Build') { stage('build') {
steps { steps {
sh 'npm install' sh 'yarn'
sh 'npm run build' sh 'yarn build'
} }
} }
stage('deploy') { stage('deploy') {
when {
anyOf { branch 'master'; branch 'develop' }
}
steps{ steps{
sh "rm -rf ${WWW}" sh "rm -rf ${WWW}"
sh "mv ${WORKSPACE}/dist ${WWW}" sh "mv ${WORKSPACE}/dist ${WWW}"