Skip to content

Commit

Permalink
misc: Improve tagging script
Browse files Browse the repository at this point in the history
This way we can push the tag *after* all the builds succeed. If
something goes wrong, we can always delete our local tag and try again.
  • Loading branch information
purpleidea committed Oct 4, 2019
1 parent d4043d3 commit 6a7d904
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,8 @@ release_ubuntu-bionic: $(PKG_UBUNTU-BIONIC)
release_archlinux: $(PKG_ARCHLINUX)

releases/$(VERSION)/mgmt-release.url: $(PKG_FEDORA-30) $(PKG_FEDORA-29) $(PKG_DEBIAN-10) $(PKG_UBUNTU-BIONIC) $(PKG_ARCHLINUX) $(SHA256SUMS_ASC)
@echo "Pushing git tag $(VERSION) to origin..."
git push origin $(VERSION)
@echo "Creating github release..."
hub release create \
-F <( echo -e "$(VERSION)\n";echo "Verify the signatures of all packages before you use them. The signing key can be downloaded from https://purpleidea.com/contact/#pgp-key to verify the release." ) \
Expand Down
10 changes: 3 additions & 7 deletions misc/tag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,12 @@ if [[ "${h}" == "${v}" ]]; then
exit 0
fi

# Give the user a chance to abort.
echo "WARN: About to tag \"${h}\" as \"${t}\" and push."
echo "Press ^C within 3s to abort."
sleep 3s
# Give the user some information.
echo "WARN: About to tag \"${h}\" as \"${t}\" locally."

# Tag and push.
# Tag and sign.
echo "release: tag $t" | git tag --file=- --sign $t
echo "INFO: Version $t is now tagged."
echo "INFO: Pushing $t to origin."
git push origin $t

# Be informative.
GIT_PAGER=cat git diff --stat "$v" "$t"
Expand Down

0 comments on commit 6a7d904

Please sign in to comment.