CRON_SETTINGS = BRANCH_NAME == "master" ? '''H * * *''' pipeline { agent any //we tell jenkins to use any available agent triggers { cron(CRON_SETTINGS) } tools { maven 'Maven' jdk 'Java-17' nodejs 'NodeJS-v14.21.3' } stages { stage ('Build-service-1') { steps { dir('./spring-project-back/microservices-config-service'){ //enter in folder to locate pom.xml sh 'mvn -B -DskipTests clean verify' } } } stage ('Build-service-2') { steps { dir('./spring-project-back/microservices-registration-service'){ sh 'mvn -B -DskipTests clean verify' } } } stage ('Build-service-3') { steps { dir ('./spring-project-back/backend-frontend-gateway-service'){ sh 'mvn -B -DskipTests clean verify' } } } stage ('Build-service-4') { steps { dir('./spring-project-back/clean-archi-business-service-address/'){ sh 'mvn -B -DskipTests clean verify' } } } stage ('Build-service-5'){ steps { dir('./spring-project-back/clean-archi-business-service-company/'){ sh 'mvn -B -DskipTests clean verify' } } } stage ('Build-service-6'){ steps{ dir('./spring-project-back/clean-archi-business-service-employee/'){ sh 'mvn -B -DskipTests clean verify' } } } stage ('Build-service-7'){ steps { dir('./spring-project-back/clean-archi-business-service-project/'){ sh 'mvn -B -DskipTests clean verify' } } } stage('NPM install'){ steps{ dir('./angular-project-front'){//enter in angular project to run some commands sh 'npm install' } } } stage('Build-frontend'){ steps{ dir('./angular-project-front'){//enter in angular project to run some commands sh 'ng build' } } } } }