[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [builders/tor-browser-build] 16/32: Bug 40414: Add tools/signing/upload-update_responses-to-staticiforme



This is an automated email from the git hooks/post-receive script.

boklm pushed a commit to branch master
in repository builders/tor-browser-build.

commit b3f7612f4cbdd5bbbc44461a32ce56dedd6c7373
Author: Nicolas Vigier <boklm@xxxxxxxxxxxxxx>
AuthorDate: Mon Feb 21 11:53:30 2022 +0100

    Bug 40414: Add tools/signing/upload-update_responses-to-staticiforme
---
 tools/signing/functions                            |  6 +++
 .../upload-update_responses-to-staticiforme        | 49 ++++++++++++++++++++++
 tools/update/publish_version.sh                    | 12 ------
 3 files changed, 55 insertions(+), 12 deletions(-)

diff --git a/tools/signing/functions b/tools/signing/functions
index f53f6ed..ed7ca8b 100644
--- a/tools/signing/functions
+++ b/tools/signing/functions
@@ -13,4 +13,10 @@ function var_is_defined {
   done
 }
 
+function check_torbrowser_version_var {
+  local tbver=$("$script_dir/../../rbm/rbm" showconf tor-browser var/torbrowser_version)
+  test "$tbver" != "$tbb_version" && exit_error "Wrong tbb_version: $tbver != $tbb_version"
+  return 0
+}
+
 . "$script_dir/set-config"
diff --git a/tools/signing/upload-update_responses-to-staticiforme b/tools/signing/upload-update_responses-to-staticiforme
new file mode 100755
index 0000000..755963b
--- /dev/null
+++ b/tools/signing/upload-update_responses-to-staticiforme
@@ -0,0 +1,49 @@
+#!/bin/bash
+set -e
+script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
+source "$script_dir/functions"
+
+check_torbrowser_version_var
+
+update_responses_tar_filename="update-responses-$tbb_version_type-$tbb_version.tar"
+update_responses_tar="$script_dir/../../$tbb_version_type/update-responses/$update_responses_tar_filename"
+if test -f "$update_responses_tar"
+then
+  echo "$update_responses_tar_filename already exists: not running 'make update_responses-$tbb_version_type'"
+else
+  echo "Running 'make update_responses-$tbb_version_type'"
+  pushd "$script_dir/../.." > /dev/null
+  make update_responses-$tbb_version_type
+  popd > /dev/null
+fi
+
+update_dir=/srv/aus1-master.torproject.org/htdocs/torbrowser/update_3
+deploy_script=$(mktemp)
+trap "rm -Rf $deploy_script" EXIT
+cat << EOF > "$deploy_script"
+#!/bin/bash
+set -e
+
+tmpdir="\$(mktemp -d)"
+
+trap "rm -Rf \$tmpdir" EXIT
+
+rm -Rf "$update_dir/$tbb_version_type.old"
+test -d "$update_dir/$tbb_version_type" && \\
+  mv -v "$update_dir/$tbb_version_type" "$update_dir/$tbb_version_type.old"
+
+tar -C "\$tmpdir" -xf ~/$update_responses_tar_filename
+chmod 775 "\$tmpdir"/$tbb_version_type
+chmod 664 "\$tmpdir"/$tbb_version_type/* "\$tmpdir"/$tbb_version_type/.htaccess
+chgrp -R torwww "\$tmpdir"/$tbb_version_type
+mv -v "\$tmpdir"/$tbb_version_type "$update_dir/$tbb_version_type"
+
+static-update-component aus1.torproject.org
+EOF
+
+chmod +x $deploy_script
+scp -p "$update_responses_tar" "$ssh_host_staticiforme:"
+scp -p $deploy_script $ssh_host_staticiforme:deploy_update_responses-$tbb_version_type.sh
+
+echo 'To enable updates you can now run:'
+echo "  ssh $ssh_host_staticiforme ./deploy_update_responses-$tbb_version_type.sh"
diff --git a/tools/update/publish_version.sh b/tools/update/publish_version.sh
index 25083e3..393701d 100755
--- a/tools/update/publish_version.sh
+++ b/tools/update/publish_version.sh
@@ -14,22 +14,10 @@ if [ -z "${PREV_TORBROWSER_VERSION}" ]; then
 	exit 1
 fi
 
-TORBROWSER_UPDATE_CHANNEL=$3
-if [ -z "${TORBROWSER_UPDATE_CHANNEL}" ]; then
-    echo "please specify the release channel (release|alpha)"
-	exit 1
-fi
-
 wget --continue -nH --cut-dirs=2 -r -l 1 "https://people.torproject.org/~sysrqb/builds/${TORBROWSER_VERSION}";
 #wget --continue -nH --cut-dirs=2 -r -l 1 "https://people.torproject.org/~gk/builds/${TORBROWSER_VERSION}";
 rm "${TORBROWSER_VERSION}/index.html*"
 
-# Rename the update responses directory to .old to make it easier to
-# revert in case of problem (see the file RollingBackUpdate for more
-# details about this)
-rm -rf "/srv/aus1-master.torproject.org/htdocs/torbrowser/update_3/${TORBROWSER_UPDATE_CHANNEL}.old"
-mv /srv/aus1-master.torproject.org/htdocs/torbrowser/update_3/"${TORBROWSER_UPDATE_CHANNEL}"{,.old}
-
 date
 mv "${TORBROWSER_VERSION}" /srv/dist-master.torproject.org/htdocs/torbrowser/
 cp "/srv/dist-master.torproject.org/htdocs/torbrowser/${PREV_TORBROWSER_VERSION}/.htaccess" "/srv/dist-master.torproject.org/htdocs/torbrowser/${TORBROWSER_VERSION}/"

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits