diff --git a/Jenkinsfile b/Jenkinsfile index a373d7d149cfa6ef443603f92a7bbdac48ab1f03..70e354c44d4abc2212f065712fd9a25aa3b0d53f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -197,7 +197,7 @@ pipeline { } } - stage('Test, build and deploy Helm Chart') { + stage('Test, build and deploy Alfa Helm Chart') { steps { script { FAILED_STAGE=env.STAGE_NAME @@ -209,7 +209,27 @@ pipeline { sh "helm package --version=${HELM_CHART_VERSION} ." - deployHelmChart(HELM_CHART_VERSION) + deployHelmChart(HELM_CHART_VERSION, "alfa") + } + } + } + } + + stage('Test, build and deploy Alfa-Client Helm Chart') { + steps { + script { + dir('alfa-client') { + FAILED_STAGE=env.STAGE_NAME + HELM_CHART_VERSION = generateHelmChartVersion() + + sh "./run_helm_test.sh" + + dir('src/main/helm') { + + sh "helm package --version=${HELM_CHART_VERSION} ." + + deployHelmChart(HELM_CHART_VERSION, "alfa-client") + } } } } @@ -295,13 +315,13 @@ pipeline { } } -Void deployHelmChart(String helmChartVersion) { +Void deployHelmChart(String helmChartVersion, String app ) { withCredentials([usernamePassword(credentialsId: 'jenkins-nexus-login', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]){ if (isReleaseBranch()) { - result = sh script: '''curl -u $USERNAME:$PASSWORD https://nexus.ozg-sh.de/service/rest/v1/components?repository=ozg-base-apps -F file=@alfa-'''+helmChartVersion+'''.tgz''', returnStdout: true + result = sh script: '''curl -u $USERNAME:$PASSWORD https://nexus.ozg-sh.de/service/rest/v1/components?repository=ozg-base-apps -F file=@'''+app+'''-'''+helmChartVersion+'''.tgz''', returnStdout: true } else { - result = sh script: '''curl -u $USERNAME:$PASSWORD https://nexus.ozg-sh.de/service/rest/v1/components?repository=ozg-base-apps-snapshot -F file=@alfa-'''+helmChartVersion+'''.tgz''', returnStdout: true + result = sh script: '''curl -u $USERNAME:$PASSWORD https://nexus.ozg-sh.de/service/rest/v1/components?repository=ozg-base-apps-snapshot -F file=@'''+app+'''-'''+helmChartVersion+'''.tgz''', returnStdout: true } if (result != '') { @@ -413,8 +433,8 @@ Void setNewGitopsVersion(String environment) { def commitMessage = "jenkins rollout ${environment} alfa version ${IMAGE_TAG}"; setNewGitopsVersion(envFile, commitMessage); - def envFile = "${environment}/application/values/alfa-client-values.yaml" - def commitMessage = "jenkins rollout ${environment} alfa-client version ${IMAGE_TAG}"; + envFile = "${environment}/application/values/alfa-client-values.yaml" + commitMessage = "jenkins rollout ${environment} alfa-client version ${IMAGE_TAG}"; setNewGitopsVersion(envFile, commitMessage); } diff --git a/alfa-client/src/test/helm/deployment_63_char_test.yaml b/alfa-client/src/test/helm/deployment_63_char_test.yaml index 1a1694bd559c30d083a6beb36301d4c8a65676c5..9aa0a8de91f7f17a01ff1120fa8be31e5aa2fa3d 100644 --- a/alfa-client/src/test/helm/deployment_63_char_test.yaml +++ b/alfa-client/src/test/helm/deployment_63_char_test.yaml @@ -30,8 +30,6 @@ release: templates: - templates/deployment.yaml set: - ozgcloud: - environment: test imagePullSecret: test-image-secret tests: diff --git a/alfa-client/src/test/helm/deployment_container_basic_test.yaml b/alfa-client/src/test/helm/deployment_container_basic_test.yaml index eb88b066b6408c738c5a619f165530297f6473c0..98f94de514785c7cd5401ca79e7abe053e868d6a 100644 --- a/alfa-client/src/test/helm/deployment_container_basic_test.yaml +++ b/alfa-client/src/test/helm/deployment_container_basic_test.yaml @@ -29,8 +29,6 @@ release: templates: - templates/deployment.yaml set: - ozgcloud: - environment: dev imagePullSecret: test-image-secret tests: diff --git a/alfa-client/src/test/helm/deployment_container_other_values_test.yaml b/alfa-client/src/test/helm/deployment_container_other_values_test.yaml index c1982a0c00e3813345f3fc09c6c22513f3c8ad27..f8f356b2e2cb81c04ac7664a9e3c1b70958e0363 100644 --- a/alfa-client/src/test/helm/deployment_container_other_values_test.yaml +++ b/alfa-client/src/test/helm/deployment_container_other_values_test.yaml @@ -30,8 +30,6 @@ release: templates: - templates/deployment.yaml set: - ozgcloud: - environment: dev imagePullSecret: test-image-secret tests: diff --git a/alfa-client/src/test/helm/deployment_container_security_context_test.yaml b/alfa-client/src/test/helm/deployment_container_security_context_test.yaml index 390441176469a3165c302f952caeb8563014492d..063aac4ae72c7c885a472a2c76b9e10aa3592a0b 100644 --- a/alfa-client/src/test/helm/deployment_container_security_context_test.yaml +++ b/alfa-client/src/test/helm/deployment_container_security_context_test.yaml @@ -29,8 +29,6 @@ release: templates: - templates/deployment.yaml set: - ozgcloud: - environment: dev imagePullSecret: test-image-secret tests: diff --git a/alfa-client/src/test/helm/deployment_defaults_labels_test.yaml b/alfa-client/src/test/helm/deployment_defaults_labels_test.yaml index b646ebf7e177c266d927dd3cbfdd4b1f4d9ad274..d1ff0f164c2da7abff8098487ba39fb834ceba38 100644 --- a/alfa-client/src/test/helm/deployment_defaults_labels_test.yaml +++ b/alfa-client/src/test/helm/deployment_defaults_labels_test.yaml @@ -29,8 +29,6 @@ release: templates: - templates/deployment.yaml set: - ozgcloud: - environment: dev imagePullSecret: test-image-secret tests: diff --git a/alfa-client/src/test/helm/deployment_defaults_topologySpreadConstraints_test.yaml b/alfa-client/src/test/helm/deployment_defaults_topologySpreadConstraints_test.yaml index d3a0002921864a8435dc22e11db2e954988878ee..1f50b122dcdacdecb722422553e2158907a09971 100644 --- a/alfa-client/src/test/helm/deployment_defaults_topologySpreadConstraints_test.yaml +++ b/alfa-client/src/test/helm/deployment_defaults_topologySpreadConstraints_test.yaml @@ -29,8 +29,6 @@ release: templates: - templates/deployment.yaml set: - ozgcloud: - environment: test imagePullSecret: test-image-secret tests: diff --git a/alfa-client/src/test/helm/deployment_env_test.yaml b/alfa-client/src/test/helm/deployment_env_test.yaml index 81b0a9cc246292dc4dc1c0243b2b7c6c0cdf52db..802602a558241461dbc490613146e339aee00802 100644 --- a/alfa-client/src/test/helm/deployment_env_test.yaml +++ b/alfa-client/src/test/helm/deployment_env_test.yaml @@ -26,8 +26,6 @@ suite: test deployment container environments templates: - templates/deployment.yaml set: - ozgcloud: - environment: dev imagePullSecret: test-image-secret tests: diff --git a/alfa-client/src/test/helm/deployment_host_aliases_test.yaml b/alfa-client/src/test/helm/deployment_host_aliases_test.yaml index 1783e271736cea8b2c582cd795576bf29fe18b77..ad5d1f8f66a03d2e87fc591fb3b06ae84f0d0077 100644 --- a/alfa-client/src/test/helm/deployment_host_aliases_test.yaml +++ b/alfa-client/src/test/helm/deployment_host_aliases_test.yaml @@ -29,8 +29,6 @@ release: templates: - templates/deployment.yaml set: - ozgcloud: - environment: test imagePullSecret: test-image-secret tests: - it: should not set spec.template.spec.hostAliases diff --git a/alfa-client/src/test/helm/deployment_imagepull_secret_test.yaml b/alfa-client/src/test/helm/deployment_imagepull_secret_test.yaml index 32810e2263dee98f127fa5e886ca9b530c24f054..8b97639531973271d9f401221eeff1a8aba6cc95 100644 --- a/alfa-client/src/test/helm/deployment_imagepull_secret_test.yaml +++ b/alfa-client/src/test/helm/deployment_imagepull_secret_test.yaml @@ -29,8 +29,6 @@ release: templates: - templates/deployment.yaml set: - ozgcloud: - environment: dev imagePullSecret: test-image-secret tests: diff --git a/alfa-client/src/test/helm/deployment_resources_test.yaml b/alfa-client/src/test/helm/deployment_resources_test.yaml index fd65bbb50c0bc9ef8a5f4c612965e4591b6fe148..c053aeb0639d0c495699aa85667f1fddb6c6a82e 100644 --- a/alfa-client/src/test/helm/deployment_resources_test.yaml +++ b/alfa-client/src/test/helm/deployment_resources_test.yaml @@ -28,8 +28,6 @@ release: templates: - templates/deployment.yaml set: - ozgcloud: - environment: dev imagePullSecret: test-image-secret tests: diff --git a/alfa-client/src/test/helm/deyploment_general_value_test.yaml b/alfa-client/src/test/helm/deyploment_general_value_test.yaml index 5dc3709500d182be021d06edec04cf4b58f57030..081ae623bd6c0db6b518a0eb7753fc0632b03fe1 100644 --- a/alfa-client/src/test/helm/deyploment_general_value_test.yaml +++ b/alfa-client/src/test/helm/deyploment_general_value_test.yaml @@ -29,8 +29,6 @@ release: templates: - templates/deployment.yaml set: - ozgcloud: - environment: dev imagePullSecret: test-image-secret