diff --git a/Jenkinsfile b/Jenkinsfile index 2d2b8428ddba5668d101555dc3aae8ca1a19c026..d5f8b7d4af8bac8e299534f279784eb6c58cd6a1 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' + withNPM(npmrcConfig: 'npm-nexus-auth') { + sh 'npm --version' + sh 'node --version' - sh 'npm cache verify' - sh 'npm install' + dir('alfa-client') { + sh 'npm cache verify' + sh 'npm install' - if (isMasterBranch()) { - withSonarQubeEnv('sonarqube-ozg-sh'){ - sh 'npm run ci-sonar' + 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.e2e b/alfa-client/Jenkinsfile.e2e index 9b55f66a5146de14b99bdb88d22821c906c2d13e..8d4455ba9f7a363efe2d0850d88b00473c1e27db 100644 --- a/alfa-client/Jenkinsfile.e2e +++ b/alfa-client/Jenkinsfile.e2e @@ -199,14 +199,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/Jenkinsfile.e2e.static b/alfa-client/Jenkinsfile.e2e.static index 2e499f9abbaf8c2918628b462f2f79a056df66d6..56b1c25a16d92dc4f13341bb10151ca853d4912d 100644 --- a/alfa-client/Jenkinsfile.e2e.static +++ b/alfa-client/Jenkinsfile.e2e.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" + } } } } 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' + } + } } } }