diff --git a/Jenkinsfile b/Jenkinsfile index aacd2836602d03d11b06595603b4cd0d1b429d39..4f3633e165f4c949795ade1bf1458a6f23333b4b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -149,9 +149,10 @@ pipeline { steps { script { def stageName = env.STAGE_NAME - def namespace = generateNamespaceName(stageName) + def bezeichner = generateBezeichner(stageName) + def namespace = generateNamespaceName(bezeichner) - startEnvironment(namespace, 'ea-values.yaml', 'ea-values.yaml', IMAGE_TAG) + startEnvironment(namespace, 'ea-values.yaml', 'ea-values.yaml', IMAGE_TAG, bezeichner) def testResult = runTests(stageName, 'einheitlicher-ansprechpartner') @@ -175,9 +176,10 @@ pipeline { steps { script { def stageName = env.STAGE_NAME - def namespace = generateNamespaceName(stageName) + def bezeichner = generateBezeichner(stageName) + def namespace = generateNamespaceName(bezeichner) - startEnvironment(namespace, 'values.yaml', 'values.yaml', IMAGE_TAG) + startEnvironment(namespace, 'values.yaml', 'values.yaml', IMAGE_TAG, bezeichner) def testResult = runTests(stageName, 'main-tests') @@ -304,15 +306,15 @@ pipeline { } } -Void startEnvironment(String namespace, String goofyValues, String plutoValues, String imageTag){ +Void startEnvironment(String namespace, String goofyValues, String plutoValues, String imageTag, String bezeichner){ checkIfNamespaceExists(namespace) parallel( startGoofy: { - startGoofy(namespace, goofyValues, imageTag) + startGoofy(namespace, goofyValues, imageTag, bezeichner) }, startPluto: { - startPluto(namespace, plutoValues) + startPluto(namespace, plutoValues, bezeichner) } ) } @@ -340,11 +342,11 @@ Void checkIfNamespaceExists(String namespace) { } } -Void startPluto(String namespace, String values) { +Void startPluto(String namespace, String values, String bezeichner) { container("k8s") { dir('goofy-client/apps/goofy-e2e/deployment-values/pluto') { withCredentials([usernamePassword(credentialsId: 'jenkins-nexus-login', usernameVariable: 'USER', passwordVariable: 'PASSWORD')]) { - sh "helm upgrade --install --create-namespace pluto pluto -f ${values} --namespace ${namespace}" + ' --repo https://nexus.ozg-sh.de/repository/ozg-base-apps --username ${USER} --password ${PASSWORD} --wait --wait-for-jobs' + sh "helm upgrade --install --create-namespace pluto pluto -f ${values} --set kop.bezeichner=${bezeichner} --namespace ${namespace}" + ' --repo https://nexus.ozg-sh.de/repository/ozg-base-apps --username ${USER} --password ${PASSWORD} --wait --wait-for-jobs' } } @@ -352,11 +354,11 @@ Void startPluto(String namespace, String values) { } } -Void startGoofy(String namespace, String values, String imageTag) { +Void startGoofy(String namespace, String values, String imageTag, String bezeichner) { container("k8s") { dir('goofy-client/apps/goofy-e2e/deployment-values/goofy') { withCredentials([usernamePassword(credentialsId: 'jenkins-nexus-login', usernameVariable: 'USER', passwordVariable: 'PASSWORD')]) { - sh "helm upgrade --install --create-namespace goofy goofy -f ${values} --set image.tag=${imageTag} --namespace ${namespace}" + ' --repo https://nexus.ozg-sh.de/repository/ozg-base-apps --username ${USER} --password ${PASSWORD} --wait --wait-for-jobs' + 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' } } @@ -397,11 +399,15 @@ String makeUrlConform(String input) { return input.replaceAll(/[^a-zA-Z0-9]+/, "").toLowerCase() } -String generateNamespaceName(String stage) { +String generateBezeichner(String stage) { def branchName = makeUrlConform(env.BRANCH_NAME) def stageName = makeUrlConform(stage) - return "e2e-${branchName}${stageName}-dev" + return "${branchName}${stageName}" +} + +String generateNamespaceName(String bezeichner) { + return "e2e-${bezeichner}-dev" } Void generateKeycloakUserYaml(String namespace) { @@ -474,7 +480,8 @@ Void removeKeycloakUser(String namespace) { } String generateCypressConfig(String stage, String testFolder) { - def namespace = generateNamespaceName(stage) + def bezeichner = generateBezeichner(stage) + def namespace = generateNamespaceName(bezeichner) def configName = "cypress-ci-"+testFolder+".json" dir('goofy-client/apps/goofy-e2e/'){ diff --git a/goofy-client/apps/goofy-e2e/deployment-values/goofy/ea-values.yaml b/goofy-client/apps/goofy-e2e/deployment-values/goofy/ea-values.yaml index 62327ac8b4b8d3dc967e662eae0feaa2621dcd36..e55cc722c93c4c5a07f4843cad6885490d689f83 100644 --- a/goofy-client/apps/goofy-e2e/deployment-values/goofy/ea-values.yaml +++ b/goofy-client/apps/goofy-e2e/deployment-values/goofy/ea-values.yaml @@ -2,7 +2,10 @@ sso: serverUrl: 'https://sso.dev.ozg-sh.de/auth' role_einheitlicher_ansprechpartner: true env: - sprintProfiles: 'oc,dev,e2e' + overrideSpringProfiles: 'oc,dev,ea,e2e' plutoName: pluto replicaCount: '1' -scrapeMetricsDisabled: true \ No newline at end of file +scrapeMetricsDisabled: true +kop: + bundesland: e2e + environment: dev \ No newline at end of file diff --git a/goofy-client/apps/goofy-e2e/deployment-values/goofy/values.yaml b/goofy-client/apps/goofy-e2e/deployment-values/goofy/values.yaml index ab3860f7dcc3a142a45ab39029ace823b944d7ce..393960b351a888f5505d80a4fe801fb3f6068ea1 100644 --- a/goofy-client/apps/goofy-e2e/deployment-values/goofy/values.yaml +++ b/goofy-client/apps/goofy-e2e/deployment-values/goofy/values.yaml @@ -1,7 +1,10 @@ sso: serverUrl: 'https://sso.dev.ozg-sh.de/auth' env: - springProfiles: 'oc, dev, e2e' + overrideSpringProfiles: 'oc, dev, e2e' plutoName: pluto replicaCount: '1' scrapeMetricsDisabled: true +kop: + bundesland: e2e + environment: dev \ No newline at end of file diff --git a/goofy-client/apps/goofy-e2e/deployment-values/pluto/ea-values.yaml b/goofy-client/apps/goofy-e2e/deployment-values/pluto/ea-values.yaml index 48ef8aaab6171bdae2e4939b427ba6150e80e989..143e5a404e9a11820e8f4cdcd4577023afc0aae9 100644 --- a/goofy-client/apps/goofy-e2e/deployment-values/pluto/ea-values.yaml +++ b/goofy-client/apps/goofy-e2e/deployment-values/pluto/ea-values.yaml @@ -5,7 +5,7 @@ env: aktenzeichen: enabled: true value: de.itvsh.ozg.pluto.vorgang.AktenzeichenProviderEA - springProfiles: "oc,ea,dev,e2e" + overrideSpringProfiles: "oc,ea,dev,e2e" image: tag: snapshot-latest kopProxyApi: @@ -26,3 +26,6 @@ osipostfach: host: 10.61.16.6 port: "3128" scrapeMetricsDisabled: true +kop: + bundesland: e2e + environment: dev \ No newline at end of file diff --git a/goofy-client/apps/goofy-e2e/deployment-values/pluto/values.yaml b/goofy-client/apps/goofy-e2e/deployment-values/pluto/values.yaml index d915bc5cb52a5898e9b30ed31d125373374847f2..6b480dc4f3e509074c4d66101c291c8328a8bbd5 100644 --- a/goofy-client/apps/goofy-e2e/deployment-values/pluto/values.yaml +++ b/goofy-client/apps/goofy-e2e/deployment-values/pluto/values.yaml @@ -5,7 +5,7 @@ env: aktenzeichen: enabled: false value: de.itvsh.ozg.pluto.vorgang.AktenzeichenProviderEA - springProfiles: "oc, dev, e2e" + overrideSpringProfiles: "oc, dev, e2e" image: tag: snapshot-latest kopProxyApi: @@ -26,3 +26,6 @@ osipostfach: host: 10.61.16.6 port: "3128" scrapeMetricsDisabled: true +kop: + bundesland: e2e + environment: dev \ No newline at end of file