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 {
NODE_ENV = ""
}
steps {
nodejs('node-v20') {
sh 'npm install --no-audit --prefer-offline'
sh 'gulp install --ci'
parallel {
stage('Backend') {
steps {
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'
}
parallel {
stage('Frontend') {
steps {
nodejs('node-v20') {
sh 'jest --ci --reporters=default --reporters=jest-junit --maxWorkers=6'
}
}
}
stage('Backend') {
steps {
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') {
@ -98,21 +115,6 @@ pipeline {
}
stage('Deploy') {
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') {
when { anyOf {
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}"
}
}
}
}
}