diff --git a/Jenkinsfile b/Jenkinsfile index 4f3633e165f4c949795ade1bf1458a6f23333b4b..cb93b611c59fb93b16444903e6d62d5f4e2d558f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -45,9 +45,9 @@ pipeline { error("Keine Snapshot Version für Branch ${env.BRANCH_NAME}.") } } - + if( !(VERSION == serverVersion && VERSION == clientVersion)){ - error("Versionen sind nicht identisch") + error("Versionen sind nicht identisch") } } } @@ -64,7 +64,7 @@ pipeline { sh 'echo "_auth=amVua2luczpQaihzX0ZNNFU5ZC8=" >> ~/.npmrc' sh 'npm install --no-optional' - + if (env.BRANCH_NAME == 'release') { sh 'npm run ci-prodBuild' } @@ -99,7 +99,7 @@ pipeline { FAILED_STAGE=env.STAGE_NAME IMAGE_TAG = "${env.BRANCH_NAME}-${VERSION}" - container("maven-17"){ + container("maven-17"){ configFileProvider([configFile(fileId: 'maven-settings', variable: 'MAVEN_SETTINGS')]) { sh 'mvn --version' sh "mvn -s $MAVEN_SETTINGS -pl -goofy-client clean install spring-boot:build-image -Dspring-boot.build-image.imageName=docker.ozg-sh.de/goofy:${IMAGE_TAG} -Dspring-boot.build-image.publish -Dmaven.wagon.http.retryHandler.count=3" @@ -145,7 +145,7 @@ pipeline { failFast false parallel { - stage('E2E-EA') { + stage('E2E-EA') { steps { script { def stageName = env.STAGE_NAME @@ -153,9 +153,9 @@ pipeline { def namespace = generateNamespaceName(bezeichner) startEnvironment(namespace, 'ea-values.yaml', 'ea-values.yaml', IMAGE_TAG, bezeichner) - + def testResult = runTests(stageName, 'einheitlicher-ansprechpartner') - + shutdownEnvironment(namespace) if(!testResult) { @@ -182,7 +182,7 @@ pipeline { startEnvironment(namespace, 'values.yaml', 'values.yaml', IMAGE_TAG, bezeichner) def testResult = runTests(stageName, 'main-tests') - + shutdownEnvironment(namespace) if(!testResult) { @@ -236,7 +236,7 @@ pipeline { branch 'release' } } - + steps { script { FAILED_STAGE = env.STAGE_NAME @@ -245,7 +245,7 @@ pipeline { script { withCredentials([usernamePassword(credentialsId: 'jenkins-docker-login', usernameVariable: 'USER', passwordVariable: 'PASSWORD')]) { sh 'docker login docker.ozg-sh.de -u ${USER} -p ${PASSWORD}' - + if (env.BRANCH_NAME == 'release') { sh "docker tag docker.ozg-sh.de/goofy:${IMAGE_TAG} docker.ozg-sh.de/goofy:latest" sh 'docker push docker.ozg-sh.de/goofy:latest' @@ -267,7 +267,7 @@ pipeline { branch 'release' } } - + steps { script { FAILED_STAGE = env.STAGE_NAME @@ -286,7 +286,7 @@ pipeline { if (env.BRANCH_NAME == 'master') { sh 'kubectl rollout restart deployment/goofy -n sh-kiel-dev' sh 'kubectl rollout status deployment/goofy -n sh-kiel-dev' - + sh 'kubectl rollout restart deployment/goofy -n sh-ea-dev' sh 'kubectl rollout status deployment/goofy -n sh-ea-dev' } @@ -361,7 +361,7 @@ Void startGoofy(String namespace, String values, String imageTag, String bezeich sh "helm upgrade --install --create-namespace goofy goofy -f ${values} --set image.tag=${imageTag} --set kop.bezeichner=${bezeichner} --namespace ${namespace}" + ' --repo https://nexus.ozg-sh.de/repository/ozg-base-apps --username ${USER} --password ${PASSWORD} --wait --wait-for-jobs' } } - + createKeycloakGroups(namespace) generateKeycloakUserYaml(namespace) applyKeycloakUser(namespace) @@ -379,6 +379,8 @@ String runTests(String stageName, String reportFolder) { return true } } catch (Exception e) { + sh "ls -l /root/.npm/_logs/*-debug.log" + sh "cat /root/.npm/_logs/*-debug.log" return false } } @@ -402,11 +404,11 @@ String makeUrlConform(String input) { String generateBezeichner(String stage) { def branchName = makeUrlConform(env.BRANCH_NAME) def stageName = makeUrlConform(stage) - + return "${branchName}${stageName}" } -String generateNamespaceName(String bezeichner) { +String generateNamespaceName(String bezeichner) { return "e2e-${bezeichner}-dev" } @@ -469,7 +471,7 @@ Void applyKeycloakUser(String namespace) { } } -Void removeKeycloakUser(String namespace) { +Void removeKeycloakUser(String namespace) { dir(namespace){ def kcUserFiles = sh (script: "ls", returnStdout: true)