From e1b2f650726fab36b648bc17796b2a4e7efe30ca Mon Sep 17 00:00:00 2001 From: Alex Tymchuk Date: Thu, 17 Aug 2023 18:16:09 +0300 Subject: [PATCH] PMM-4817 use ssh vs https in create-tags script (#2420) --- build/scripts/create-tags | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/build/scripts/create-tags b/build/scripts/create-tags index 8ee080809d..0f12d9f27c 100755 --- a/build/scripts/create-tags +++ b/build/scripts/create-tags @@ -44,24 +44,26 @@ if ! git clone --branch "pmm-${VERSION}" --single-branch https://github.com/Perc fi cd "$REPO_DIR" >/dev/null -git submodule update +git submodule update --init for REPO in "${repos[@]}"; do pushd "$REPO" >/dev/null - # git remote set-url origin git@github.com:${REPO}.git - echo "SHA: $(git rev-parse HEAD)" + REPO_URL=$(git config --get remote.origin.url | sed -e "s|^https://github.com/||") + git remote set-url origin git@github.com:${REPO_URL}.git if git tag -l | grep "$TAG"; then echo "Fatal: tag $TAG already exists in $REPO, exiting..." break fi + echo "Tagging SHA: $(git rev-parse HEAD)" if [ -n "$CI" ]; then # We can't sign tags in CI, so we create them without signing git tag --message="Version $VERSION." "$TAG" else git tag --message="Version $VERSION." --sign "$TAG" fi + if ! git push origin "$TAG"; then echo "Fatal: failed to tag the repository $REPO with $TAG, exiting..." popd >/dev/null