update_files 1.48 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/bash
#
# This file is part of GetTor, a Tor Browser distribution system.
#
# :authors: hiro <hiro@torproject.org>
#           see also AUTHORS file
#
# :copyright:   (c) 2008-2019, The Tor Project, Inc.
#
# :license: This is Free Software. See LICENSE for license information.

cd ~/releases
13
14
15
16
17
18
19
git checkout naster
git branch -D releases
git push origin --delete releases
git branch -D torbrowser-releases
git push github --delete torbrowser-releases

git fetch --all --prune
20
21
22
23
24
25
26
27
28
29
30
31

for row in $(
    curl -s 'https://aus1.torproject.org/torbrowser/update_3/release/downloads.json' |
    jq -r '.downloads'
  ); do
    r=$(
      echo ${row} |
      egrep -o 'https?://[^ ]+' |
      tr -d '",'
    );
    if [[ $r = *[!\ ]* ]]; then
      wget $r
Hiro's avatar
Hiro committed
32
      git fetch --all
33
      git checkout -b releases
Hiro's avatar
Hiro committed
34
35
36
37
38
39
40
41
      git add .
      git commit -m '[dist ci] commit from CI runner - update with new torbrowser downloads'
      diffs=$(git diff origin/releases)
      if [ -z "$diffs" ]; then
          echo "No new releases"
      else
          git push -f --follow-tags origin releases
      fi
42
      git checkout -b torbrowser-releases
Hiro's avatar
Hiro committed
43
44
45
46
47
48
      diffs=$(git diff github/torbrowser-releases)
      if [ -z "$diffs" ]; then
          echo "No new releases"
      else
          git push -f --follow-tags github torbrowser-releases
      fi
49
50
    fi;
done
51
52
53
54
55

rclone delete gdrive:releases

for f in $(ls); do
  rclone copy $f gdrive:releases
Hiro's avatar
Hiro committed
56
  ia upload <identifier> - --remote-name=$f --metadata="title:New Tor Browser release ${f}."
57
done