ci(magicleaps): switch magicleaps alpha ci to develop branch

Signed-off-by: zhenyus <zhenyus@mathmast.com>
This commit is contained in:
zhenyus 2025-02-18 01:31:47 +08:00
parent 358d8c5109
commit bd785eb2c2

View File

@ -13,25 +13,33 @@ class ArgoApplicationVersionUpdater {
def update(environmentSlug, component) {
steps.log.info("ArgoApplicationVersionUpdater", "[${environmentSlug}] Update Argo application image version to ${steps.env.BUILD_IMAGE_VERSION} for ${component.name}...")
steps.sh "ls -al ${workspace}"
def valuesFile = "${workspace}/${configurations.serviceName}/helm-pkg/${configurations.serviceName}/values-${environmentSlug}.yaml"
def data = steps.readYaml (file: valuesFile)
data.${component.name}.image.registry = steps.env.BUILD_IMAGE_REGISTRY
data.${component.name}.image.repository = steps.env.BUILD_IMAGE_REPOSITORY
data.${component.name}.image.tag = steps.env.BUILD_IMAGE_VERSION
data.${component.name}.image.name = steps.env.BUILD_IMAGE_NAME
steps.writeFile file: valuesFile, data: data, overwrite: true
steps.log.info("ArgoApplicationVersionUpdater", "[${environmentSlug}] Pull freeleaps-ops repository to workspace...")
steps.withCredentials([steps.usernamePassword(credentialsId: 'freeleaps-ops-credentials', passwordVariable: 'OPS_GIT_PASSWORD', usernameVariable: 'OPS_GIT_USERNAME')]) {
steps.sh """
git config user.name "freeleaps-gitops-bot"
git config user.email "gitops@mathmast.com"
git remote add ci_origin https://${OPS_GIT_USERNAME}:${OPS_GIT_PASSWORD}@dev.azure.com/freeleaps/freeleaps-ops/_git/freeleaps-ops
git add ${valuesFile}
git commit -m "ci(bump): bump ${component.name} image version for ${environmentSlug} to ${steps.env.BUILD_IMAGE_VERSION}"
git push ci_origin HEAD:master
"""
steps.log.info("ArgoApplicationVersionUpdater", "[${environmentSlug}] ${component.name} image version bump to ${steps.env.BUILD_IMAGE_VERSION}")
steps.dir("${workspace}") {
steps.git branch: 'master', credentialsId: 'freeleaps-ops-credentials', url: 'https://freeleaps@dev.azure.com/freeleaps/freeleaps-ops/_git/freeleaps-ops'
this.workspace = "${workspace}/freeleaps-ops"
}
steps.dir("${workspace}") {
def valuesFile = "./${configurations.serviceName}/helm-pkg/${configurations.serviceName}/values-${environmentSlug}.yaml"
def data = steps.readYaml (file: valuesFile)
data.${component.name}.image.registry = steps.env.BUILD_IMAGE_REGISTRY
data.${component.name}.image.repository = steps.env.BUILD_IMAGE_REPOSITORY
data.${component.name}.image.tag = steps.env.BUILD_IMAGE_VERSION
data.${component.name}.image.name = steps.env.BUILD_IMAGE_NAME
steps.writeFile file: valuesFile, data: data, overwrite: true
steps.withCredentials([steps.usernamePassword(credentialsId: 'freeleaps-ops-credentials', passwordVariable: 'OPS_GIT_PASSWORD', usernameVariable: 'OPS_GIT_USERNAME')]) {
steps.sh """
git config user.name "freeleaps-gitops-bot"
git config user.email "gitops@mathmast.com"
git remote add ci_origin https://${OPS_GIT_USERNAME}:${OPS_GIT_PASSWORD}@dev.azure.com/freeleaps/freeleaps-ops/_git/freeleaps-ops
git add ${valuesFile}
git commit -m "ci(bump): bump ${component.name} image version for ${environmentSlug} to ${steps.env.BUILD_IMAGE_VERSION}"
git push ci_origin HEAD:master
"""
steps.log.info("ArgoApplicationVersionUpdater", "[${environmentSlug}] ${component.name} image version bump to ${steps.env.BUILD_IMAGE_VERSION}")
}
}
}
}