pipeline { agent any tools { nodejs 'node-15.5.1' } stages { stage('Pre Test') { steps { echo 'Installing dependencies' sh 'npm --version' sh 'npm install' echo 'Setting permission for build script' sh "chmod +x do.sh" } } stage('Compile') { steps { sh './do.sh build' } } stage('Test') { parallel{ stage('lint') { steps { echo 'Running vetting' sh './do.sh _lint' } } stage('stylelint') { steps { echo 'Running stylelint' sh './do.sh _stylelint' } } stage('test') { steps { echo 'Running test' sh './do.sh _jest' junit "junit.xml" cobertura coberturaReportFile: 'coverage/cobertura-coverage.xml' } } } } } post { always { mail (bcc: '', body: "Project: ${env.JOB_NAME}
Build Number: ${env.BUILD_NUMBER}
Build URL: ${env.BUILD_URL}", cc: '', charset: 'UTF-8', from: 'jenkins@jenkins.deepak.science', mimeType: 'text/html', replyTo: 'dmallubhotla+jenkins@gmail.com', subject: "${env.JOB_NAME} #${env.BUILD_NUMBER}: Build ${currentBuild.currentResult}", to: "dmallubhotla+ci@gmail.com") } } }