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"
}
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"
}
# 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
########## 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
echo "INFO: Merge will tag ref: $ref"
git checkout "$ref"
- tag-gerrit-repo
+ tag-git-repo
}
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,
echo "INFO: uploading $filecount distributions to repo $REPOSITORY"
$cmd
fi
- tag-gerrit-repo
+ tag-git-repo
}
packagecloud_verify(){
| 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 ################################