forked from getlantern/lantern
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstallMetaRefresh.bash
More file actions
executable file
·61 lines (46 loc) · 1.74 KB
/
Copy pathinstallMetaRefresh.bash
File metadata and controls
executable file
·61 lines (46 loc) · 1.74 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/env bash
function die() {
echo $*
exit 1
}
if [ $# -ne "4" ]
then
die "$0: Received $# args... dir, name, name of latest file (latest.dmg), and whether this is a release version required"
fi
dir=$1
name=$2
latestName=$3
release=$4
echo "Release version: $release"
bucket=lantern
url=https://s3.amazonaws.com/$bucket/$name
echo "Uploading to http://cdn.getlantern.org/$name..."
aws -putp $bucket $name
echo "Uploaded lantern to http://cdn.getlantern.org/$name"
echo "Also available at $url"
if $release ; then
echo "RELEASING!!!!!"
# pushd install/$dir || die "Could not change directories"
# perl -pi -e "s;url_token;$url;g" $latestName || die "Could not replace URL token"
# Makes sure it actually was replaced
# grep $url $latestName || die "Something went wrong with creating latest dummy file"
# Here's the trick -- send a custom mime type that's html instead of the mime type for the file extension
# aws -putpm $bucket $latestName text/html || die "Could not upload latest?"
# git checkout $latestName || die "Could not checkout"
# popd
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
# md5 -q $name > $latestName.md5
# echo "Uploading MD5 `cat $latestName.md5`"
# aws -putp $bucket $latestName.md5
#cp install/common/lantern.jar $latestName.jar || die "Could not copy latest jar?"
#pack200 $latestName.pack.gz $latestName.jar || die "Could not pack jar?"
#echo "Uploading latest jar: $latestName.pack.gz"
#aws -putp $bucket $latestName.pack.gz
else
echo "NOT RELEASING!!!"
fi
echo "INSTALLER AVAILABLE AT `pwd`/$name"