ci: refs#6706 Jenkinsfile fixes

This commit is contained in:
Juan Ferrer 2024-02-06 10:20:04 +01:00
parent 3c140266f4
commit b3e658f9aa
1 changed files with 59 additions and 47 deletions

54
Jenkinsfile vendored
View File

@ -5,7 +5,8 @@ def FROM_GIT
def RUN_TESTS
def RUN_BUILD
pre: {
node {
stage('Setup') {
switch (env.BRANCH_NAME) {
case 'test':
env.NODE_ENV = 'test'
@ -34,6 +35,7 @@ pre: {
// https://loopback.io/doc/en/lb3/Setting-debug-strings.html#debug-strings-reference
//env.DEBUG = 'strong-remoting:shared-method'
}
}
pipeline {
agent any
options {
@ -47,29 +49,47 @@ pipeline {
STACK_NAME = "${env.PROJECT_NAME}-${env.BRANCH_NAME}"
}
stages {
stage('Install') {
environment {
NODE_ENV = ''
}
parallel {
stage('Back') {
steps {
sh 'pnpm install --prefer-offline'
}
}
stage('Print') {
when {
expression { FROM_GIT }
}
steps {
sh 'pnpm install --prefer-offline --prefix=print'
}
}
stage('Front') {
when {
expression { FROM_GIT }
}
steps {
sh 'pnpm install --prefer-offline --prefix=front'
}
}
}
}
stage('Stack') {
environment {
NODE_ENV = ""
TZ = 'Europe/Madrid'
}
parallel {
stage('Back') {
stages {
stage('Install') {
environment {
NODE_ENV = ""
}
steps {
sh 'pnpm install --prefer-offline'
sh 'pnpm install --prefer-offline --prefix=print'
}
}
stage('Test') {
when {
expression { RUN_TESTS }
}
environment {
NODE_ENV = ""
NODE_ENV = ''
}
steps {
sh 'npm run test:back:ci'
@ -106,20 +126,12 @@ pipeline {
expression { FROM_GIT }
}
stages {
stage('Install') {
environment {
NODE_ENV = ""
}
steps {
sh 'pnpm install --prefer-offline --prefix=front'
}
}
stage('Test') {
when {
expression { RUN_TESTS }
}
environment {
NODE_ENV = ""
NODE_ENV = ''
}
steps {
sh 'jest --ci --reporters=default --reporters=jest-junit --maxWorkers=10'