mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-24 20:36:40 +07:00
fixed jenkins for PRs
This commit is contained in:
parent
201b55d463
commit
88a22b4889
1 changed files with 11 additions and 13 deletions
24
Jenkinsfile
vendored
24
Jenkinsfile
vendored
|
@ -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}"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue