Unverified Commit ed8709b2 authored by boklm's avatar boklm
Browse files

Bug 40414: Add tools/signing/upload-update_responses-to-staticiforme

parent 3460d136
......@@ -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"
#!/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"
......@@ -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}/"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment