Skip to content

Commit

Permalink
Find a different place to cache the sandstorm-171 bundle
Browse files Browse the repository at this point in the history
This way, git won't list the file in `git status` and `make clean` won't wipe
it out and force you to re-download the bundle.
  • Loading branch information
zarvox committed Aug 11, 2016
1 parent a46ddd1 commit 7774349
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions hack/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sandstorm-171.tar.xz
9 changes: 5 additions & 4 deletions make-bundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,17 @@ cp $METEOR_DEV_BUNDLE/bin/node bundle/bin
# Pull mongo v2.6 out of a previous Sandstorm package.
OLD_BUNDLE_BASE=sandstorm-171
OLD_BUNDLE_FILENAME=$OLD_BUNDLE_BASE.tar.xz
OLD_BUNDLE_PATH=hack/$OLD_BUNDLE_FILENAME
OLD_BUNDLE_SHA256=ebffd643dffeba349f139bee34e4ce33fd9b1298fafc1d6a31eb35a191059a99
OLD_MONGO_FILES="$OLD_BUNDLE_BASE/bin/mongo $OLD_BUNDLE_BASE/bin/mongod"
if [ ! -e "$OLD_BUNDLE_FILENAME" ] ; then
if [ ! -e "$OLD_BUNDLE_PATH" ] ; then
echo "Fetching $OLD_BUNDLE_FILENAME to extract a mongo 2.6..."
curl --output "$OLD_BUNDLE_FILENAME" https://dl.sandstorm.io/$OLD_BUNDLE_FILENAME
curl --output "$OLD_BUNDLE_PATH" https://dl.sandstorm.io/$OLD_BUNDLE_FILENAME
fi

# Always check the checksum to guard against corrupted downloads.
sha256sum --check <<EOF
$OLD_BUNDLE_SHA256 $OLD_BUNDLE_FILENAME
$OLD_BUNDLE_SHA256 $OLD_BUNDLE_PATH
EOF
# set -e should ensure we don't continue past here, but let's be doubly sure
rc=$?
Expand All @@ -129,7 +130,7 @@ if [ $rc -ne 0 ]; then
fi

# Extract bin/mongo and bin/mongod from the old sandstorm bundle, and place them in bundle/.
tar xf $OLD_BUNDLE_FILENAME --transform=s/^${OLD_BUNDLE_BASE}/bundle/ $OLD_MONGO_FILES
tar xf $OLD_BUNDLE_PATH --transform=s/^${OLD_BUNDLE_BASE}/bundle/ $OLD_MONGO_FILES

cp $(which zip unzip xz gpg) bundle/bin

Expand Down

0 comments on commit 7774349

Please sign in to comment.