Skip to content

Commit

Permalink
GH-16527 Fix heml chart buckets and git credentials (#16577)
Browse files Browse the repository at this point in the history
* Fix helm charts bucket for nightly and test release

* Replace PrivateKey credentials with token autorization

(cherry picked from commit 34e336f)
  • Loading branch information
valenad1 committed Feb 26, 2025
1 parent b6b3a47 commit 823752d
Showing 1 changed file with 23 additions and 18 deletions.
41 changes: 23 additions & 18 deletions scripts/jenkins/jenkinsfiles/Jenkinsfile-Release
Original file line number Diff line number Diff line change
Expand Up @@ -167,30 +167,35 @@ try {
try {
pipelineContext.getBuildSummary().addStageSummary(this, TAG_STAGE_NAME, env.BUILD_NUMBER_DIR)
pipelineContext.getBuildSummary().setStageDetails(this, TAG_STAGE_NAME, env.NODE_NAME, env.WORKSPACE)
sh """
git config --global user.name "h2o-ops"
git config --global user.email "[email protected]"
"""
withCredentials([
usernamePassword(credentialsId: 'H2O-OPS-GH-TOKEN', usernameVariable: 'GH_USERNAME', passwordVariable: 'GH_TOKEN'),
string(credentialsId: "H2O_OPS_GH_EMAIL", variable: "GH_EMAIL"),
]) {
sh """
git config --global user.name "${GH_USERNAME}"
git config --global user.email "${GH_EMAIL}"
cd ${env.BUILD_NUMBER_DIR}
git remote set-url origin https://${GH_TOKEN}@github.com/h2oai/h2o-3.git
"""
}
sh """
cd ${env.BUILD_NUMBER_DIR}
git tag -a jenkins-${env.BRANCH_NAME}-${currentBuild.number} -m "Jenkins build branch_name ${env.BRANCH_NAME} build_number ${env.PROJECT_VERSION}"
"""
sshagent (credentials: ['h2oOpsGitPrivateKey']) {
if ((env.NIGHTLY_BUILD == null || env.NIGHTLY_BUILD.toLowerCase() == 'false')) {
sh """
cd ${env.BUILD_NUMBER_DIR}
echo "Process release tags"
git tag -d jenkins-rel-latest-stable
git push origin :refs/tags/jenkins-rel-latest-stable
git tag -a jenkins-rel-latest-stable -f -m "Jenkins build branch_name ${env.BRANCH_NAME} build_number ${env.PROJECT_VERSION}"
git tag -a jenkins-${env.PROJECT_VERSION} -m "Jenkins build branch_name ${env.BRANCH_NAME} build_number ${env.PROJECT_VERSION}"
"""
}
if ((env.NIGHTLY_BUILD == null || env.NIGHTLY_BUILD.toLowerCase() == 'false')) {
sh """
cd ${env.BUILD_NUMBER_DIR}
git push --tags
echo "Process release tags"
git tag -d jenkins-rel-latest-stable
git push origin :refs/tags/jenkins-rel-latest-stable
git tag -a jenkins-rel-latest-stable -f -m "Jenkins build branch_name ${env.BRANCH_NAME} build_number ${env.PROJECT_VERSION}"
git tag -a jenkins-${env.PROJECT_VERSION} -m "Jenkins build branch_name ${env.BRANCH_NAME} build_number ${env.PROJECT_VERSION}"
"""
}
sh """
cd ${env.BUILD_NUMBER_DIR}
git push --tags
"""
pipelineContext.getBuildSummary().markStageSuccessful(this, TAG_STAGE_NAME)
} catch (Exception e) {
pipelineContext.getBuildSummary().markStageFailed(this, TAG_STAGE_NAME)
Expand Down Expand Up @@ -503,12 +508,12 @@ EOF

if (params.TEST_RELEASE) {
CHART_NAME = "h2o-test-3"
BUCKET = "h2oai-test-charts"
BUCKET = "h2oai-test-helm-charts"
VERSION = THREE_DIGITS_VERSION
} else{
if(env.NIGHTLY_BUILD){
CHART_NAME = "h2o-3-nightly"
BUCKET = "h2oai-nightly-charts"
BUCKET = "h2oai-nightly-helm-charts"
VERSION = THREE_DIGITS_VERSION
} else {
CHART_NAME = "h2o-3"
Expand Down

0 comments on commit 823752d

Please sign in to comment.