-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
Showing
1 changed file
with
23 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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) | ||
|
@@ -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" | ||
|