diff --git a/Jenkinsfile b/Jenkinsfile index 285906b8f2..246fa94c23 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -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) {