Unverified Commit b5e5e4b3 authored by Matthew Finkel's avatar Matthew Finkel Committed by boklm
Browse files

Bug 40137: Add publication script

parent e485133a
Loading
Loading
Loading
Loading
+64 −0
Original line number Diff line number Diff line
#!/usr/bin/perl -w

# Read ChangeLog.txt from stdin
#   $ ./format_changelog.pl < ChangeLog.txt

my $once = 0;
my $last_indent=0;

sub finish {
    while ($last_indent > 2) {
        print "</ul>\n";
        # Every entry in the ChangeLog is indented by 2 characters
        # except for the first Platform line
        $last_indent -= 2
    }
    exit;
}

while (<>) {
    #print "$_";
    my $line = "";
    if ($_ =~ /^Tor Browser /) {
        finish() unless $once == 0;
        $once = 1;
        next;
    }
    # Skip empty lines
    if ($_ =~ /^\s*$/) {
        next;
    }
    #print ">>> $_";
    if ($_ =~ /(\s+)\* Bug (\d+):(.*)$/) {
        my $indentation = $1;
        my $bug = $2;
        my $description = $3;
        my $current_indent = length($indentation);
        if ($current_indent > $last_indent) {
            $line = "<ul>";
        } elsif ($current_indent < $last_indent) {
            $line = "</ul>";
        }
        $last_indent = $current_indent;
        if ($bug < 40000) {
            $line.="<li><a href=\"https://bugs.torproject.org/$bug\">Bug $bug</a>:$3</li>";
        } else {
            $description =~ /(.*)\[([a-z-]*)\]$/;
            my $project = "tpo/applications/$2/$bug" // "$bug";
            $line.="<li><a href=\"https://bugs.torproject.org/$project\">Bug $bug</a>:$1</li>";
        }
    } elsif ($_ =~ /(\s+)\* (.*)$/) {
        my $indentation = $1;
        my $current_indent = length($indentation);
        if ($current_indent > $last_indent) {
            $line = "<ul>";
        } elsif ($current_indent < $last_indent) {
            $line = "</ul>";
        }
        $last_indent = $current_indent;
        $line .= "<li>$2";
    } else {
        $line = $_;
    }
    print "$line\n";
}
+51 −0
Original line number Diff line number Diff line
#!/bin/bash

set -e

TORBROWSER_VERSION=$1
if [ -z "${TORBROWSER_VERSION}" ]; then
    echo "please specify version number (excluding -buildN)"
	exit 1
fi

PREV_TORBROWSER_VERSION=$2
if [ -z "${PREV_TORBROWSER_VERSION}" ]; then
    echo "please specify a previous version number (needed for copying .htaccess file)"
	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}/"
chmod 775 "/srv/dist-master.torproject.org/htdocs/torbrowser/${TORBROWSER_VERSION}"
chmod 664 "/srv/dist-master.torproject.org/htdocs/torbrowser/${TORBROWSER_VERSION}"/*
chown -R :torwww "/srv/dist-master.torproject.org/htdocs/torbrowser/${TORBROWSER_VERSION}"
cd "/srv/dist-master.torproject.org/htdocs/torbrowser/${TORBROWSER_VERSION}"
for i in *.asc; do echo "$i"; gpg -q "$i" || exit; done
date
static-update-component dist.torproject.org

mkdir "/srv/cdn-master.torproject.org/htdocs/aus1/torbrowser/${TORBROWSER_VERSION}"
chmod 775 "/srv/cdn-master.torproject.org/htdocs/aus1/torbrowser/${TORBROWSER_VERSION}"
cd "/srv/cdn-master.torproject.org/htdocs/aus1/torbrowser/${TORBROWSER_VERSION}"
for marfile in /srv/dist-master.torproject.org/htdocs/torbrowser/"${TORBROWSER_VERSION}"/*.mar; do ln -f "${marfile}" .; done
date
static-update-component cdn.torproject.org

echo "Now sync and publish update responses"