forked from getlantern/lantern
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreleaseExisting.bash
executable file
·46 lines (37 loc) · 1.21 KB
/
releaseExisting.bash
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env bash
# This script moves existing installers to be the "latest" release installers
# users will actually install using the installer wrappers.
function die() {
echo $*
exit 1
}
if [ $# -ne "1" ]
then
die "$0: Received $# args, expected base name such as lantern-1.0.0-beta7-789a299"
fi
baseName=$1
bucket="lantern"
names=($baseName.exe $baseName.dmg $baseName-32-bit.deb $baseName-64-bit.deb)
#names=($baseName-32-bit.deb $baseName-64-bit.deb)
for name in "${names[@]}"
do
echo "$name"
if [ "$name" == "$baseName.exe" ]; then
echo "Setting latest"
latestName="latest.exe"
elif [ "$name" == "$baseName.dmg" ]; then
latestName="latest.dmg"
elif [ "$name" == "$baseName-32-bit.deb" ]; then
latestName="latest-32.deb"
elif [ "$name" == "$baseName-64-bit.deb" ]; then
latestName="latest-64.deb"
fi
echo "Latest name: $latestName"
echo "Downloading existing file..."
test -f $name || curl -O https://s3.amazonaws.com/lantern/$name
echo "Copying on S3 to latest file"
./copys3file.py $name || die "Could not copy s3 file to latest!"
shasum $name | cut -d " " -f 1 > $latestName.sha1
echo "Uploading SHA-1 `cat $latestName.sha1`"
aws -putp $bucket $latestName.sha1
done