ci: refs#6706 Jenkinsfile tuning
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Juan Ferrer 2024-02-04 21:17:47 +01:00
parent 9cda07bc5a
commit 766008ce1a
1 changed files with 68 additions and 76 deletions

144
Jenkinsfile vendored
View File

@ -53,81 +53,85 @@ pipeline {
TZ = 'Europe/Madrid'
}
parallel {
stage('Backend') { stages {
stage('Install') {
environment {
NODE_ENV = ""
stage('Backend') {
stages {
stage('Install') {
environment {
NODE_ENV = ""
}
steps {
sh 'pnpm install --prefer-offline'
sh 'pnpm install --prefer-offline --prefix=print'
}
}
steps {
sh 'pnpm install --prefer-offline'
sh 'pnpm install --prefer-offline --prefix=print'
}
}
stage('Test') {
when {
expression { RUN_TESTS }
}
environment {
NODE_ENV = ""
}
steps {
sh 'npm run test:back:ci'
}
post {
always {
script {
try {
junit 'junitresults.xml'
junit 'junit.xml'
} catch (e) {
echo e.toString()
stage('Test') {
when {
expression { RUN_TESTS }
}
environment {
NODE_ENV = ""
}
steps {
sh 'npm run test:back:ci'
}
post {
always {
script {
try {
junit 'junitresults.xml'
junit 'junit.xml'
} catch (e) {
echo e.toString()
}
}
}
}
}
}
stage('Build') {
when {
expression { RUN_BUILD }
}
steps {
sh 'docker-compose build back'
stage('Build') {
when {
expression { RUN_BUILD }
}
steps {
sh 'docker-compose build back'
}
}
}
}}
stage('Frontend') { stages {
stage('Install') {
when {
expression { FROM_GIT }
}
stage('Frontend') {
when {
expression { FROM_GIT }
}
stages {
stage('Install') {
environment {
NODE_ENV = ""
}
steps {
sh 'pnpm install --prefer-offline --prefix=front'
}
}
environment {
NODE_ENV = ""
stage('Test') {
when {
expression { RUN_TESTS }
}
environment {
NODE_ENV = ""
}
steps {
sh 'jest --ci --reporters=default --reporters=jest-junit --maxWorkers=10'
}
}
steps {
sh 'pnpm install --prefer-offline --prefix=front'
stage('Build') {
when {
expression { RUN_BUILD }
}
steps {
sh 'gulp build'
sh 'docker-compose build front'
}
}
}
stage('Test') {
when {
expression { RUN_TESTS }
}
environment {
NODE_ENV = ""
}
steps {
sh 'jest --ci --reporters=default --reporters=jest-junit --maxWorkers=10'
}
}
stage('Build') {
when {
expression { RUN_BUILD }
}
steps {
sh 'gulp build'
sh 'docker-compose build front'
}
}
}}
}
}
}
stage('Push') {
@ -183,18 +187,6 @@ pipeline {
}
}
post {
always {
script {
if (RUN_TESTS) {
try {
junit 'junitresults.xml'
junit 'junit.xml'
} catch (e) {
echo e.toString()
}
}
}
}
success {
script {
if (env.BRANCH_NAME == 'master' && FROM_GIT) {