Skip to content

Commit

Permalink
Fixed naming closes #1685
Browse files Browse the repository at this point in the history
  • Loading branch information
myleshorton committed Aug 6, 2014
1 parent 3319e56 commit b877dd7
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 115 deletions.
21 changes: 16 additions & 5 deletions copys3file.py
Expand Up @@ -4,23 +4,34 @@
import boto
from boto.s3.key import Key

# DRY: installMetaRefresh.bash
if len(sys.argv) < 2:
print "Need file name and base name of generic latest installer, as in 'copys3file.py lantern-1.4.4-6dfa980.dmg lantern-installer'"
sys.exit(1)

# DRY: deployBinaries.bash
BUCKET = 'lantern'

key = str(sys.argv[1])
newestname = str(sys.argv[2])

if key.endswith('dmg'):
newest = 'newest.dmg'
ext = '.dmg'
elif key.endswith('exe'):
newest = 'newest.exe'
ext = '.exe'
elif key.endswith('32-bit.deb'):
newest = 'newest-32.deb'
ext = '-32.deb'
elif key.endswith('64-bit.deb'):
newest = 'newest-64.deb'
ext = '-64.deb'
else:
print 'File name with full version required. .deb files should end in 32-bit.deb or 64-bit.deb'
sys.exit(1)

#newest = newestname + ext

# This is all actually handled externally. TODO -- do it all here! Fix deployBinaries and releaseExisting and do everything through boto/python
newest = newestname
print 'Newest name %s' % newest

conn = boto.connect_s3()

b = conn.get_bucket(BUCKET)
Expand Down
23 changes: 0 additions & 23 deletions debDeploy.bash

This file was deleted.

3 changes: 0 additions & 3 deletions debDeploy32Bit.bash

This file was deleted.

3 changes: 0 additions & 3 deletions debDeploy64Bit.bash

This file was deleted.

2 changes: 1 addition & 1 deletion debInstall.bash
Expand Up @@ -30,6 +30,6 @@ git=`git rev-parse --verify lantern-$VERSION^{commit} | cut -c1-7`
name=lantern-$VERSION-$git-$ARCH-bit.deb
mv install/lantern*$ARCH*.deb $name || die "Could not find built installer to copy?"

./deployBinaries.bash $name newest-$ARCH.deb $RELEASE || die "Could not deploy deb!!"
./deployBinaries.bash $name lantern-installer-$ARCH.deb $RELEASE || die "Could not deploy deb!!"

#cp $name ~/Desktop/virtual-machine-files/
2 changes: 1 addition & 1 deletion deployBinaries.bash
Expand Up @@ -43,7 +43,7 @@ if $release ; then
# popd

echo "Copying on S3 to newest file"
./copys3file.py $name || die "Could not copy s3 file to newest!"
./copys3file.py $name $newestName || die "Could not copy s3 file to newest!"

shasum $name | cut -d " " -f 1 > $newestName.sha1

Expand Down
67 changes: 0 additions & 67 deletions installMetaRefresh.bash

This file was deleted.

2 changes: 1 addition & 1 deletion osxInstall.bash
Expand Up @@ -21,5 +21,5 @@ install4jc -v --mac-keystore-password=$INSTALL4J_MAC_PASS -m macos -r $VERSION .
git=`git rev-parse --verify lantern-$VERSION^{commit} | cut -c1-7`
name=lantern-$VERSION-$git.dmg
mv install/Lantern.dmg $name || die "Could not move new installer -- failed to create somehow?"
./deployBinaries.bash $name newest.dmg $RELEASE || die "ERROR: Could not deploy binaries"
./deployBinaries.bash $name lantern-installer.dmg $RELEASE || die "ERROR: Could not deploy binaries"

28 changes: 18 additions & 10 deletions releaseExisting.bash
Expand Up @@ -9,44 +9,52 @@ function die() {
exit 1
}

if [ $# -ne "1" ]
if [ $# -ne "2" ]
then
die "$0: Received $# args, expected base name such as lantern-1.0.0-beta7-789a299"
die "$0: Received $# args, expected base name and gneeric installer base name, as in 'lantern-1.0.0-beta7-789a299 lantern-installer'"
fi

baseName=$1
bucket="lantern"
names=($baseName.exe $baseName.dmg $baseName-32-bit.deb $baseName-64-bit.deb)
tag=${baseName:0:${#baseName}-8}
#names=($baseName-32-bit.deb $baseName-64-bit.deb)
newest=$2

for name in "${names[@]}"
do
echo "$name"
if [ "$name" == "$baseName.exe" ]; then
echo "Setting newest"
newestName="newest.exe"
ext=".exe"
elif [ "$name" == "$baseName.dmg" ]; then
newestName="newest.dmg"
ext=".dmg"
elif [ "$name" == "$baseName-32-bit.deb" ]; then
newestName="newest-32.deb"
ext="-32.deb"
elif [ "$name" == "$baseName-64-bit.deb" ]; then
newestName="newest-64.deb"
ext="-64.deb"
fi

newestName=$newest$ext
echo "Latest name: $newestName"

echo "Downloading existing file..."
fullurl=https://s3.amazonaws.com/lantern/$name
echo "Downloading existing file from $fullurl"

test -f $name || curl -O https://s3.amazonaws.com/lantern/$name

test -f $name || die "File still does not exist at $name?"

echo "Copying on S3 to newest file"
./copys3file.py $name || die "Could not copy s3 file to newest!"
./copys3file.py $name $newestName || die "Could not copy s3 file to newest!"

echo "Uploading binary $name to tag 'latest'"
#echo "Uploading binary $name to tag 'latest'"
#./uploadghasset.rb latest $name

echo "Uploading binary $name to tag '$tag'"
#echo "Uploading binary $name to tag '$tag'"
#./uploadghasset.rb $tag $name

# TODO: DO ALL THIS IN THE PYTHON SCRIPT
shasum $name | cut -d " " -f 1 > $newestName.sha1
echo "Uploading SHA-1 `cat $newestName.sha1`"
aws -putp $bucket $newestName.sha1
Expand Down
2 changes: 1 addition & 1 deletion winInstall.bash
Expand Up @@ -21,4 +21,4 @@ install4jc -v --win-keystore-password=$INSTALL4J_WIN_PASS -m windows -r $VERSION
git=`git rev-parse --verify lantern-$VERSION^{commit} | cut -c1-7`
name=lantern-$VERSION-$git.exe
mv install/Lantern.exe $name || die "Could not move new installer -- failed to create somehow?"
./deployBinaries.bash $name newest.exe $RELEASE || die "ERROR: Could not deploy binaries"
./deployBinaries.bash $name lantern-installer.exe $RELEASE || die "ERROR: Could not deploy binaries"

0 comments on commit b877dd7

Please sign in to comment.