From: Anil Belur Date: Sat, 23 Jan 2021 02:24:04 +0000 (+0000) Subject: Merge "Revert "Remove the -only CLI option for packer build"" X-Git-Tag: v0.60.3^0 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=b0de8e76ba8c4e2cacbef206d7864e856b1ffc1d;hp=8b0974bca7d163cf322c978efdf7b9d1dd2e265a;p=releng%2Fglobal-jjb.git Merge "Revert "Remove the -only CLI option for packer build"" --- diff --git a/releasenotes/notes/generatlize-tag-function-self-release-10be50b5d7e741cd.yaml b/releasenotes/notes/generatlize-tag-function-self-release-10be50b5d7e741cd.yaml new file mode 100644 index 00000000..b1789b27 --- /dev/null +++ b/releasenotes/notes/generatlize-tag-function-self-release-10be50b5d7e741cd.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Rename "tag-gerrit-repo" function in self releases to "tag-git-repo". + This change is in preparation for self releases support for GitHub based + projects. Use the name "git-repo" to fit both Gerrit and Github projects. diff --git a/shell/release-job.sh b/shell/release-job.sh index eba269b8..7ac6fc58 100644 --- a/shell/release-job.sh +++ b/shell/release-job.sh @@ -146,7 +146,7 @@ set_variables_container(){ printf "\t%-30s %s\n" CONTAINER_RELEASE_TAG: "$VERSION" printf "\t%-30s %s\n" CONTAINER_PULL_REGISTRY: "$CONTAINER_PULL_REGISTRY" printf "\t%-30s %s\n" CONTAINER_PUSH_REGISTRY: "$CONTAINER_PUSH_REGISTRY" - printf "\t%-30s %s\n" GERRIT_REF_TO_TAG: "$ref" + printf "\t%-30s %s\n" GIT_REF_TO_TAG: "$ref" printf "\t%-30s %s\n" GIT_TAG: "$GIT_TAG" } @@ -209,7 +209,7 @@ set_variables_packagecloud(){ printf "\t%-30s %s\n" PACKAGE_NAME: "$PACKAGE_NAME" printf "\t%-30s %s\n" LOG_DIR: "$LOG_DIR" printf "\t%-30s %s\n" LOGS_URL: "$logs_url" - printf "\t%-30s %s\n" GERRIT_REF_TO_TAG: "$REF" + printf "\t%-30s %s\n" GIT_REF_TO_TAG: "$REF" printf "\t%-30s %s\n" VERSION: "$VERSION" printf "\t%-30s %s\n" GIT_TAG: "$GIT_TAG" } @@ -285,13 +285,19 @@ verify_packagecloud_match_release(){ # sigul is only available on Centos # TODO: write tag-github-repo function -tag-gerrit-repo(){ +tag-git-repo(){ if [[ $TAG_RELEASE == false ]]; then - echo "INFO: Skipping gerrit repo tag" + echo "INFO: Skipping code repo tag" return fi - echo "INFO: tag gerrit with $GIT_TAG" + if [[ -z ${GERRIT_URL:-} ]]; then + GIT_REPO_BASE=github + else + GIT_REPO_BASE=gerrit + fi + + echo "INFO: tag repo with $GIT_TAG" # Import public signing key gpg --import "$SIGNING_PUBKEY" if type=$(git cat-file -t "$GIT_TAG"); then @@ -312,12 +318,16 @@ tag-gerrit-repo(){ ########## Merge Part ############## if [[ "$JOB_NAME" =~ "merge" ]] && [[ "$DRY_RUN" = false ]]; then echo "INFO: Running merge, pushing tag" - gerrit_ssh=$(echo "$GERRIT_URL" | awk -F"/" '{print $3}') - git remote set-url origin ssh://"$RELEASE_USERNAME"@"$gerrit_ssh":29418/"$PROJECT" + if [[ $GIT_REPO_BASE == "gerrit" ]]; then + gerrit_ssh=$(echo "$GERRIT_URL" | awk -F"/" '{print $3}') + git remote set-url origin ssh://"$RELEASE_USERNAME"@"$gerrit_ssh":29418/"$PROJECT" + echo -e "Host $gerrit_ssh\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config + chmod 600 ~/.ssh/config + else + git remote set-url origin "$GIT_CLONE_URL""$RELEASE_USERNAME"/"$PROJECT".git + fi git config user.name "$RELEASE_USERNAME" git config user.email "$RELEASE_EMAIL" - echo -e "Host $gerrit_ssh\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config - chmod 600 ~/.ssh/config git push origin "$GIT_TAG" fi fi @@ -386,7 +396,7 @@ container_release_file(){ echo "INFO: Merge will tag ref: $ref" git checkout "$ref" - tag-gerrit-repo + tag-git-repo } maven_release_file(){ @@ -403,7 +413,7 @@ maven_release_file(){ git fetch "$PATCH_DIR/${PROJECT//\//-}.bundle" git merge --ff-only FETCH_HEAD nexus_release - tag-gerrit-repo + tag-git-repo } # calls pip to download binary and source distributions from the specified index, @@ -448,7 +458,7 @@ pypi_release_file(){ echo "INFO: uploading $filecount distributions to repo $REPOSITORY" $cmd fi - tag-gerrit-repo + tag-git-repo } packagecloud_verify(){ @@ -478,7 +488,7 @@ packagecloud_promote(){ | echo "INFO: Promoted package location: \ https://packagecloud.io$(yq -r .package_html_url)" git checkout "$REF" - tag-gerrit-repo + tag-git-repo } ############################## End Function Declarations ################################