build: refs #5483 Parallel install, code reorder
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Juan Ferrer 2024-01-30 20:04:32 +01:00
parent 1a64126655
commit 7d2b5fbeda
1 changed files with 43 additions and 26 deletions

69
Jenkinsfile vendored
View File

@ -41,10 +41,27 @@ pipeline {
environment { environment {
NODE_ENV = "" NODE_ENV = ""
} }
steps { parallel {
nodejs('node-v20') { stage('Backend') {
sh 'npm install --no-audit --prefer-offline' steps {
sh 'gulp install --ci' nodejs('node-v20') {
sh 'npm install --no-audit --prefer-offline'
}
}
}
stage('Frontend') {
steps {
nodejs('node-v20') {
sh 'npm install --no-audit --prefer-offline --prefix=front'
}
}
}
stage('Print') {
steps {
nodejs('node-v20') {
sh 'npm install --no-audit --prefer-offline --prefix=print'
}
}
} }
} }
} }
@ -61,13 +78,6 @@ pipeline {
TZ = 'Europe/Madrid' TZ = 'Europe/Madrid'
} }
parallel { parallel {
stage('Frontend') {
steps {
nodejs('node-v20') {
sh 'jest --ci --reporters=default --reporters=jest-junit --maxWorkers=6'
}
}
}
stage('Backend') { stage('Backend') {
steps { steps {
nodejs('node-v20') { nodejs('node-v20') {
@ -75,6 +85,13 @@ pipeline {
} }
} }
} }
stage('Frontend') {
steps {
nodejs('node-v20') {
sh 'jest --ci --reporters=default --reporters=jest-junit --maxWorkers=6'
}
}
}
} }
} }
stage('Build') { stage('Build') {
@ -98,21 +115,6 @@ pipeline {
} }
stage('Deploy') { stage('Deploy') {
parallel { parallel {
stage('Docker') {
when {
environment name: 'RUN_SOURCE', value: 'git'
anyOf {
branch 'test'
branch 'master'
}
}
environment {
DOCKER_HOST = "${env.SWARM_HOST}"
}
steps {
sh "docker stack deploy --with-registry-auth --compose-file docker-compose.yml ${env.STACK_NAME}"
}
}
stage('Database') { stage('Database') {
when { anyOf { when { anyOf {
branch 'dev' branch 'dev'
@ -132,6 +134,21 @@ pipeline {
} }
} }
} }
stage('Docker') {
when {
environment name: 'RUN_SOURCE', value: 'git'
anyOf {
branch 'test'
branch 'master'
}
}
environment {
DOCKER_HOST = "${env.SWARM_HOST}"
}
steps {
sh "docker stack deploy --with-registry-auth --compose-file docker-compose.yml ${env.STACK_NAME}"
}
}
} }
} }
} }