From 78ece6399b85c7f03384d34b4cc769ee8aa081dd Mon Sep 17 00:00:00 2001 From: OZGCloud <ozgcloud@mgm-tp.com> Date: Tue, 2 Apr 2024 15:25:47 +0200 Subject: [PATCH] adjust Jenkinsfile formatting; remove try catch for ci-test --- Jenkinsfile.admin | 41 +++++++++++++++++++--------------------- alfa-client/package.json | 1 - 2 files changed, 19 insertions(+), 23 deletions(-) diff --git a/Jenkinsfile.admin b/Jenkinsfile.admin index 56c20de85b..32dd06e291 100644 --- a/Jenkinsfile.admin +++ b/Jenkinsfile.admin @@ -34,31 +34,28 @@ pipeline { stage('build admin client and its docker image') { steps { script { - FAILED_STAGE=env.STAGE_NAME - - dir('alfa-client') { - sh 'echo "registry=https://nexus.ozg-sh.de/repository/npm-proxy" >> ~/.npmrc' - sh 'echo "//nexus.ozg-sh.de/:_auth=amVua2luczprTSFnNVUhMVQzNDZxWQ==" >> ~/.npmrc' - - sh 'npm cache verify' - sh 'npm install' - - if (isReleaseBranch()) { - sh 'npm run ci-prodBuild-admin' - } else { - sh 'npm run ci-build-admin' - } - if (isMasterBranch()) { - try { + FAILED_STAGE=env.STAGE_NAME + + dir('alfa-client') { + sh 'echo "registry=https://nexus.ozg-sh.de/repository/npm-proxy" >> ~/.npmrc' + sh 'echo "//nexus.ozg-sh.de/:_auth=amVua2luczprTSFnNVUhMVQzNDZxWQ==" >> ~/.npmrc' + + sh 'npm cache verify' + sh 'npm install' + + if (isReleaseBranch()) { + sh 'npm run ci-prodBuild-admin' + } else { + sh 'npm run ci-build-admin' + } + if (isMasterBranch()) { withSonarQubeEnv('sonarqube-ozg-sh'){ - sh 'npm run ci-sonar-admin' + sh 'npm run ci-sonar' } + } else { + sh 'npm run ci-test' } - catch (Exception e) { - unstable("SonarQube failed") - } - } - } + } } } } diff --git a/alfa-client/package.json b/alfa-client/package.json index fcc5b9638e..6c07b2b9f1 100644 --- a/alfa-client/package.json +++ b/alfa-client/package.json @@ -20,7 +20,6 @@ "ci-prodBuild-admin": "nx container admin && cp -r dist/ apps/admin/", "ci-test": "nx run-many --target=test --parallel 8 -- --runInBand", "ci-sonar": "nx run-many --target=test --parallel 8 -- --runInBand --codeCoverage --coverageReporters=lcov --testResultsProcessor=jest-sonar-reporter && npx sonar-scanner", - "ci-sonar-admin": "nx run admin:test --runInBand --codeCoverage --coverageReporters=lcov --testResultsProcessor=jest-sonar-reporter && npx sonar-scanner -Dsonar.projectBaseDir=./apps/admin", "lint": "nx workspace-lint && nx lint", "affected:apps": "nx affected:apps", "affected:libs": "nx affected:libs", -- GitLab