Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Commit

Permalink
skip cypress
Browse files Browse the repository at this point in the history
  • Loading branch information
nileshgulia1 committed Nov 3, 2021
1 parent bee7b22 commit 876c96d
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -121,30 +121,30 @@ pipeline {
// }
// }

stage('Report to SonarQube') {
// Exclude Pull-Requests
when {
allOf {
environment name: 'CHANGE_ID', value: ''
}
}
steps {
node(label: 'swarm') {
script{
checkout scm
unstash "xunit-reports"
unstash "cypress-coverage"
def scannerHome = tool 'SonarQubeScanner';
def nodeJS = tool 'NodeJS11';
withSonarQubeEnv('Sonarqube') {
sh '''sed -i "s#/opt/frontend/my-volto-project/src/addons/${GIT_NAME}/##g" xunit-reports/coverage/lcov.info'''
sh "export PATH=$PATH:${scannerHome}/bin:${nodeJS}/bin; sonar-scanner -Dsonar.javascript.lcov.reportPaths=./xunit-reports/coverage/lcov.info,./cypress-coverage/coverage/lcov.info -Dsonar.sources=./src -Dsonar.projectKey=$GIT_NAME-$BRANCH_NAME -Dsonar.projectVersion=$BRANCH_NAME-$BUILD_NUMBER"
sh '''try=2; while [ \$try -gt 0 ]; do curl -s -XPOST -u "${SONAR_AUTH_TOKEN}:" "${SONAR_HOST_URL}api/project_tags/set?project=${GIT_NAME}-${BRANCH_NAME}&tags=${SONARQUBE_TAGS},${BRANCH_NAME}" > set_tags_result; if [ \$(grep -ic error set_tags_result ) -eq 0 ]; then try=0; else cat set_tags_result; echo "... Will retry"; sleep 60; try=\$(( \$try - 1 )); fi; done'''
}
}
}
}
}
// stage('Report to SonarQube') {
// // Exclude Pull-Requests
// when {
// allOf {
// environment name: 'CHANGE_ID', value: ''
// }
// }
// steps {
// node(label: 'swarm') {
// script{
// checkout scm
// unstash "xunit-reports"
// unstash "cypress-coverage"
// def scannerHome = tool 'SonarQubeScanner';
// def nodeJS = tool 'NodeJS11';
// withSonarQubeEnv('Sonarqube') {
// sh '''sed -i "s#/opt/frontend/my-volto-project/src/addons/${GIT_NAME}/##g" xunit-reports/coverage/lcov.info'''
// sh "export PATH=$PATH:${scannerHome}/bin:${nodeJS}/bin; sonar-scanner -Dsonar.javascript.lcov.reportPaths=./xunit-reports/coverage/lcov.info,./cypress-coverage/coverage/lcov.info -Dsonar.sources=./src -Dsonar.projectKey=$GIT_NAME-$BRANCH_NAME -Dsonar.projectVersion=$BRANCH_NAME-$BUILD_NUMBER"
// sh '''try=2; while [ \$try -gt 0 ]; do curl -s -XPOST -u "${SONAR_AUTH_TOKEN}:" "${SONAR_HOST_URL}api/project_tags/set?project=${GIT_NAME}-${BRANCH_NAME}&tags=${SONARQUBE_TAGS},${BRANCH_NAME}" > set_tags_result; if [ \$(grep -ic error set_tags_result ) -eq 0 ]; then try=0; else cat set_tags_result; echo "... Will retry"; sleep 60; try=\$(( \$try - 1 )); fi; done'''
// }
// }
// }
// }
// }

stage('Pull Request') {
when {
Expand Down

0 comments on commit 876c96d

Please sign in to comment.