From f72262d896ba5e09e1e681e0d82075d412e814b0 Mon Sep 17 00:00:00 2001 From: Martin <git@mail.de> Date: Fri, 21 Mar 2025 16:23:47 +0100 Subject: [PATCH] OZG-7952 rename in JenkinsFile and related scripts --- alfa-client/apps/admin/Jenkinsfile | 36 +++++++++++++++--------------- alfa-client/package.json | 4 ++-- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/alfa-client/apps/admin/Jenkinsfile b/alfa-client/apps/admin/Jenkinsfile index 8ae0ccfcdb..2253bfcdd6 100644 --- a/alfa-client/apps/admin/Jenkinsfile +++ b/alfa-client/apps/admin/Jenkinsfile @@ -50,7 +50,7 @@ pipeline { steps { script { FAILED_STAGE = env.STAGE_NAME - VERSION = getAdminPackageJsonVersion() + VERSION = getPackageJsonVersion() if(isReleaseBranch()){ if ( !isReleaseVersion([VERSION]) ) { @@ -65,7 +65,7 @@ pipeline { } } - stage('Build admin client and its docker image') { + stage('Build administration client and its docker image') { steps { script { FAILED_STAGE=env.STAGE_NAME @@ -75,9 +75,9 @@ pipeline { sh 'pnpm install --frozen-lockfile' if (isReleaseBranch()) { - sh 'pnpm run ci-prodBuild-admin' + sh 'pnpm run ci-prodBuild-administration' } else { - sh 'pnpm run ci-build-admin' + sh 'pnpm run ci-build-administration' } if (isMainBranch()) { withSonarQubeEnv('sonarqube-ozg-sh'){ @@ -148,7 +148,7 @@ pipeline { stage('Trigger Test rollout') { when { - branch 'release-admin' + branch 'release-administration' } steps { script { @@ -176,7 +176,7 @@ pipeline { Boolean isReleaseBranch() { - return env.BRANCH_NAME == 'release-admin' + return env.BRANCH_NAME == 'release-administration' } def validateBranchName(branchName) { @@ -224,24 +224,24 @@ Void setNewTestVersion() { Void setNewGitopsVersion(String environment) { dir("gitops") { - def envFile = "${environment}/application/values/admin-client-values.yaml" + def envFile = "${environment}/application/values/administration-client-values.yaml" def envVersions = readYaml file: envFile - envVersions.admin_client.image.tag = IMAGE_TAG - envVersions.admin_client.helm.version = HELM_CHART_VERSION + envVersions.administration_client.image.tag = IMAGE_TAG + envVersions.administration_client.helm.version = HELM_CHART_VERSION writeYaml file: envFile, data: envVersions, overwrite: true if (hasValuesFileChanged(environment)) { sh "git add ${envFile}" - sh "git commit -m 'jenkins rollout ${environment} admin_client version ${IMAGE_TAG}'" + sh "git commit -m 'jenkins rollout ${environment} administration_client version ${IMAGE_TAG}'" } } } Boolean hasValuesFileChanged(String environment) { - return sh (script: "git status | grep '${environment}/application/values/admin-client-values.yaml'", returnStatus: true) == env.SH_SUCCESS_STATUS_CODE as Integer + return sh (script: "git status | grep '${environment}/application/values/administration-client-values.yaml'", returnStatus: true) == env.SH_SUCCESS_STATUS_CODE as Integer } @@ -263,11 +263,11 @@ Void tagAndPushDockerImage(String newTag){ withCredentials([usernamePassword(credentialsId: 'jenkins-nexus-login', usernameVariable: 'USER', passwordVariable: 'PASSWORD')]) { sh 'docker login docker.ozg-sh.de -u ${USER} -p ${PASSWORD}' - sh "docker tag docker.ozg-sh.de/admin-client:build-latest docker.ozg-sh.de/admin-client:${newTag}" - sh "docker push docker.ozg-sh.de/admin-client:${newTag}" + sh "docker tag docker.ozg-sh.de/administration-client:build-latest docker.ozg-sh.de/administration-client:${newTag}" + sh "docker push docker.ozg-sh.de/administration-client:${newTag}" } } -String getAdminPackageJsonVersion() { +String getPackageJsonVersion() { def packageJSON = readJSON file: 'alfa-client/apps/admin/package.json' def packageJSONVersion = packageJSON.version echo packageJSONVersion @@ -277,10 +277,10 @@ String getAdminPackageJsonVersion() { Void deployHelmChart(String helmChartVersion) { 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=@admin-client-'''+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=@administration-client-'''+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=@admin-client-'''+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=@administration-client-'''+helmChartVersion+'''.tgz''', returnStdout: true } if (result != '') { @@ -296,9 +296,9 @@ Boolean isMainBranch() { Void sendFailureMessage() { def room = '' def data = """{"msgtype":"m.text", \ - "body":"Admin-Client: Build Failed. Stage: ${FAILED_STAGE} Build-ID: ${env.BUILD_NUMBER} Link: ${JENKINS_URL}", \ + "body":"Administration-Client: Build Failed. Stage: ${FAILED_STAGE} Build-ID: ${env.BUILD_NUMBER} Link: ${JENKINS_URL}", \ "format": "org.matrix.custom.html", \ - "formatted_body":"Admin-Client: Build Failed. Stage: ${FAILED_STAGE} Build-ID: <a href='${JENKINS_URL}'>${env.BUILD_NUMBER}</a>"}""" + "formatted_body":"Administration-Client: Build Failed. Stage: ${FAILED_STAGE} Build-ID: <a href='${JENKINS_URL}'>${env.BUILD_NUMBER}</a>"}""" if (isMainBranch()) { room = "!iQPAvQIiRwRpNOszjw:matrix.ozg-sh.de" diff --git a/alfa-client/package.json b/alfa-client/package.json index d6a7bffddc..d4e51a736a 100644 --- a/alfa-client/package.json +++ b/alfa-client/package.json @@ -17,9 +17,9 @@ "test:lib": "nx test ${npm_config_lib}", "test:debug:lib": "nx test ${npm_config_lib} --detectOpenHandles --watchAll", "ci-build": "nx run alfa:build --outputHashing=all", - "ci-build-admin": "nx container admin", + "ci-build-administration": "nx container admin", "ci-prodBuild": "nx run alfa:build --outputHashing=all --configuration production", - "ci-prodBuild-admin": "nx container admin", + "ci-prodBuild-administration": "nx container admin", "ci-test": "nx run-many --target=test --parallel 20 -- --runInBand", "ci-sonar": "nx run-many --target=test --parallel 20 -- --runInBand --codeCoverage --coverageReporters=lcov --testResultsProcessor=jest-sonar-reporter && pnpm exec sonar-scanner", "lint": "nx workspace-lint && nx lint", -- GitLab