diff --git a/Jenkinsfile b/Jenkinsfile index 1ab8edc5cc6893467c0899840c921efe0f1e550e..eb46e2e1adb1367ae3a76b5bd6edde1a5830f42b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -53,27 +53,27 @@ pipeline { script { FAILED_STAGE=env.STAGE_NAME - sh 'npm --version' - sh 'node --version' - 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 (isMasterBranch()) { - withSonarQubeEnv('sonarqube-ozg-sh'){ - sh 'npm run ci-sonar' + withNPM(npmrcConfig: 'npm-nexus-auth') { + sh 'npm --version' + sh 'node --version' + + dir('alfa-client') { + sh 'npm cache verify' + sh 'npm install' + + if (isMasterBranch()) { + withSonarQubeEnv('sonarqube-ozg-sh'){ + sh 'npm run ci-sonar' + } + } else { + sh 'npm run ci-test' + } + if (isReleaseBranch()) { + sh 'npm run ci-prodBuild' + } + else { + sh 'npm run ci-build' } - } else { - sh 'npm run ci-test' - } - if (isReleaseBranch()) { - sh 'npm run ci-prodBuild' - } - else { - sh 'npm run ci-build' } } } @@ -92,7 +92,9 @@ pipeline { dir('alfa-client') { IMAGE_TAG = generateImageTag() - sh 'npm run ci-build-alfa-client-container' + withNPM(npmrcConfig: 'npm-nexus-auth') { + sh 'npm run ci-build-alfa-client-container' + } withCredentials([usernamePassword(credentialsId: 'jenkins-nexus-login', usernameVariable: 'USER', passwordVariable: 'PASSWORD')]) { sh 'docker login docker.ozg-sh.de -u ${USER} -p ${PASSWORD}' diff --git a/Jenkinsfile.admin b/Jenkinsfile.admin index 32dd06e2912dab4d05728b2baddb0e95ee9bba0a..e361112618597808cba0a9d55d2bdd89091042fe 100644 --- a/Jenkinsfile.admin +++ b/Jenkinsfile.admin @@ -35,27 +35,26 @@ pipeline { 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()) { - withSonarQubeEnv('sonarqube-ozg-sh'){ - sh 'npm run ci-sonar' + + withNPM(npmrcConfig: 'npm-nexus-auth') { + dir('alfa-client') { + 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' + } + } else { + sh 'npm run ci-test' } - } else { - sh 'npm run ci-test' - } - } + } + } } } } diff --git a/alfa-client/Jenkinsfile.storybook b/alfa-client/Jenkinsfile.storybook index b589706023ff460ecc9ec5c164b431b464c8c610..714fe26bca0e8cdcb704bacae4b8d490e3b55fc3 100644 --- a/alfa-client/Jenkinsfile.storybook +++ b/alfa-client/Jenkinsfile.storybook @@ -36,20 +36,14 @@ pipeline { steps { script { FAILED_STAGE=env.STAGE_NAME - - dir('alfa-client') { - - withNPM(npmrcConfig: 'a4272a20-bb67-4cf7-8ce5-a1c3ac66613c') { - sh 'npm cache verify' - sh 'npm install' - sh 'npm run ci-storybook' - } - - - - - } + withNPM(npmrcConfig: 'npm-nexus-auth') { + dir('alfa-client') { + sh 'npm cache verify' + sh 'npm install' + sh 'npm run ci-storybook' + } + } } } } diff --git a/alfa-client/apps/alfa-e2e/Jenkinsfile b/alfa-client/apps/alfa-e2e/Jenkinsfile index 4d9192728334431b0219afb7c8ac6372cf9bdaab..22dd8d42af4d5d81c7c163d876aa3ce3e0949d73 100644 --- a/alfa-client/apps/alfa-e2e/Jenkinsfile +++ b/alfa-client/apps/alfa-e2e/Jenkinsfile @@ -190,14 +190,13 @@ pipeline { script { FAILED_STAGE = env.STAGE_NAME - sh 'npm --version' - 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' - sh "npm run cypress:install" + withNPM(npmrcConfig: 'npm-nexus-auth') { + sh 'npm --version' + dir('alfa-client') { + sh 'npm cache verify' + sh 'npm install' + sh "npm run cypress:install" + } } } } diff --git a/alfa-client/apps/alfa-e2e/Jenkinsfile-static b/alfa-client/apps/alfa-e2e/Jenkinsfile-static index 49a92dd823cb02a53f072fa3a55f21facc3c6527..01673a51834ec605746262d077c006133faf0067 100644 --- a/alfa-client/apps/alfa-e2e/Jenkinsfile-static +++ b/alfa-client/apps/alfa-e2e/Jenkinsfile-static @@ -149,14 +149,13 @@ pipeline { script { FAILED_STAGE = env.STAGE_NAME - sh 'npm --version' - 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' - sh "npm run cypress:install" + withNPM(npmrcConfig: 'npm-nexus-auth') { + sh 'npm --version' + dir('alfa-client') { + sh 'npm cache verify' + sh 'npm install' + sh "npm run cypress:install" + } } } }