Skip to content
Snippets Groups Projects
Verified Commit 15ee5d47 authored by ma1's avatar ma1
Browse files

Bug 41381: More flexible tagging script.

parent eec3a378
No related tags found
1 merge request!1155Bug 41381: More flexible tagging script.
......@@ -37,11 +37,11 @@ This script gpg signs a git tag associated with a particular browser commit in t
#### Prerequisites
- The user must create the following soft-links:
- The user may create the following soft-links (by default they are automatically pointed to ../../git_clones/firefox):
- `/tools/browser/basebrowser` -> `/path/to/local/tor-browser.git`
- `/tools/browser/mullvadbrowser` -> `/path/to/local/mullvad-browser.git`
- `/tools/browser/torbrowser` -> `/path/to/local/tor-browser.git`
- The user must first checkout the relevant branch of the commit we are tagging
- The user must first checkout the relevant branch (local or remote-tracking) of the commit we are tagging
- This is needed to extract the ESR version, branch-number, and browser name
#### Usage
......
......
......@@ -18,7 +18,9 @@ browser=$(echo "$script_name" | perl -pe 's/^[^\.]+\.//')
case "${browser}" in
basebrowser | torbrowser | mullvadbrowser)
# go down to browser directory
pushd ${script_dir}/${browser} > /dev/null
browser_dir="$script_dir/$browser"
[ -e "$browser_dir" ] || ln -s "../../git_clones/firefox" "$browser_dir"
pushd "$browser_dir" > /dev/null
# and exit on script termination
trap "popd > /dev/null" EXIT
;;
......@@ -33,7 +35,7 @@ esac
# and message
#
branch_name=$(git rev-parse --abbrev-ref HEAD)
branch_name=$(git log -n1 --oneline --decorate=short | grep -Eo '[a-z]+-browser-[1-9][0-9]+[^),]*-[1-9]' | head -n1)
if [[ $branch_name =~ ^([a-z]+-browser)-([1-9][0-9]+\.[0-9]+)(\.[0-9]+esr|a[1-9][0-9]*)-([1-9][0-9]*\.[05])-([1-9]).*$ ]]; then
project="${BASH_REMATCH[1]}"
upstream="${BASH_REMATCH[2]}${BASH_REMATCH[3]}"
......@@ -77,8 +79,10 @@ commit=$(git rev-parse --short ${3:-HEAD})
# channel validation
if [[ "${project}" == "mullvad-browser" ]]; then
repo="$project"
valid_channels=("rapid" "alpha" "stable")
else
repo="tor-browser"
valid_channels=("rapid" "alpha" "stable" "legacy")
fi
channel_valid=false
......@@ -113,3 +117,9 @@ echo " tag: ${tag}"
echo " message: ${message}"
git tag -s "${tag}" "${commit}" -m "${message}"
read -p "Do you want to push ${tag} to ${repo}.git? (y/N) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
git push "git@gitlab.torproject.org:tpo/applications/${repo}.git" "${tag}"
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment