Skip to content

Commit

Permalink
Merge pull request meteor#3702 from meteor/mbrewer-devBundle
Browse files Browse the repository at this point in the history
Mbrewer dev bundle
  • Loading branch information
Matthew Brewer committed Mar 20, 2015
2 parents 87a0366 + b5b78c5 commit 7a75453
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 18 deletions.
8 changes: 4 additions & 4 deletions scripts/admin/copy-bootstrap-tarballs-from-jenkins.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# Requires s3cmd to be installed and an appropriate ~/.s3cfg.
# Requires awscli to be installed and an appropriate ~/.aws/config.
# Usage:
# scripts/admin/copy-bootstrap-tarballs-from-jenkins.sh BUILDNUMBER
# where BUILDNUMBER is the small integer Jenkins build number.
Expand All @@ -18,7 +18,7 @@ if [ $# -ne 1 ]; then
fi

# bootstrap-tarballs--${METEOR_RELEASE}--${BUILD_ID}--${BUILD_NUMBER}--${GIT_COMMIT}
DIRNAME=$(s3cmd ls s3://com.meteor.jenkins/ | perl -nle 'print $1 if m!/(bootstrap-tarballs--.+--.+--'$1'--.+)/!')
DIRNAME=$(aws s3 ls s3://com.meteor.jenkins/ | perl -nle 'print $1 if m!/(bootstrap-tarballs--.+--.+--'$1'--.+)/!')
RELEASE=$(echo $DIRNAME | perl -pe 's/^bootstrap-tarballs--(.+)--.+--.+--.+$/$1/')

if [ -z "$DIRNAME" ]; then
Expand All @@ -31,10 +31,10 @@ echo "Found build $DIRNAME"

trap "echo Found surprising number of tarballs." EXIT
# Check to make sure the proper number of each kind of file is there.
s3cmd ls "s3://com.meteor.jenkins/$DIRNAME/" | \
aws s3 ls "s3://com.meteor.jenkins/$DIRNAME/" | \
perl -nle 'if (/\.tar\.gz/) { ++$TAR } else { die "something weird" } END { exit !($TAR == 4) }'

trap - EXIT

echo Copying to "$TARGET"
s3cmd -P cp -r "s3://com.meteor.jenkins/$DIRNAME/" "$TARGET$RELEASE"
aws s3 cp --acl public-read --recursive "s3://com.meteor.jenkins/$DIRNAME/" "$TARGET$RELEASE"
19 changes: 10 additions & 9 deletions scripts/admin/copy-dev-bundle-from-jenkins.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# Requires s3cmd to be installed and an appropriate ~/.s3cfg.
# Requires awscli to be installed and an appropriate ~/.aws/config.
# Usage:
# scripts/admin/copy-dev-bundle-from-jenkins.sh [--prod] BUILDNUMBER
# where BUILDNUMBER is the small integer Jenkins build number.
Expand All @@ -24,7 +24,7 @@ if [ $# -ne 1 ]; then
exit 1
fi

DIRNAME=$(s3cmd ls s3://com.meteor.jenkins/ | perl -nle 'print $1 if m!/(dev-bundle-.+--'$1'--.+)/!')
DIRNAME=$(aws s3 ls s3://com.meteor.jenkins/ | perl -nle 'print $1 if m!/(dev-bundle-.+--'$1'--.+)/!')

if [ -z "$DIRNAME" ]; then
echo "build not found" 1>&2
Expand All @@ -35,17 +35,18 @@ echo Found build $DIRNAME

trap "echo Found surprising number of tarballs." EXIT
# Check to make sure the proper number of each kind of file is there.
s3cmd ls s3://com.meteor.jenkins/$DIRNAME/ | \
aws s3 ls s3://com.meteor.jenkins/$DIRNAME/ | \
perl -nle 'if (/\.tar\.gz/) { ++$TAR } else { die "something weird" } END { exit !($TAR == 4) }'

trap - EXIT

for FILE in $(s3cmd ls s3://com.meteor.jenkins/$DIRNAME/ | perl -nlaF/ -e 'print $F[-1]'); do
if s3cmd info $TARGET$FILE >/dev/null 2>&1; then
echo "$TARGET$FILE already exists (maybe from another branch?)"
exit 1
fi
for FILE in $(aws s3 ls s3://com.meteor.jenkins/$DIRNAME/ | perl -nlaF/ -e 'print $F[-1]'); do
# aws s3 ls returns 0 when it lists nothing
if [[ $(aws s3 ls $TARGET$FILE >/dev/null | wc -l) != 0 ]]; then
echo "$TARGET$FILE already exists (maybe from another branch?)"
exit 1
fi
done

echo Copying to $TARGET
s3cmd -P cp -r s3://com.meteor.jenkins/$DIRNAME/ $TARGET
aws s3 cp --acl public-read --recursive s3://com.meteor.jenkins/$DIRNAME/ $TARGET
10 changes: 5 additions & 5 deletions scripts/admin/copy-windows-installer-from-jenkins.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# Run this script on Mac/Linux, not on Windows
# Requires s3cmd to be installed and an appropriate ~/.s3cfg.
# Requires awscli to be installed and an appropriate ~/.aws/config.
# Usage:
# scripts/admin/copy-windows-installer-from-jenkins.sh BUILDNUMBER
# where BUILDNUMBER is the small integer Jenkins build number.
Expand All @@ -19,7 +19,7 @@ if [ $# -ne 1 ]; then
fi

# installer-windows--${METEOR_RELEASE}--${BUILD_ID}--${BUILD_NUMBER}--${GIT_COMMIT}
DIRNAME=$(s3cmd ls s3://com.meteor.jenkins/ | perl -nle 'print $1 if m!/(installer-windows--.+--.+--'$1'--.+)/!')
DIRNAME=$(aws s3 ls s3://com.meteor.jenkins/ | perl -nle 'print $1 if m!/(installer-windows--.+--.+--'$1'--.+)/!')
RELEASE=$(echo $DIRNAME | perl -pe 's/^installer-windows--(.+)--.+--.+--.+$/$1/')

if [ -z "$DIRNAME" ]; then
Expand All @@ -29,11 +29,11 @@ fi

echo Found build "$DIRNAME"

if ! s3cmd info "s3://com.meteor.jenkins/$DIRNAME/InstallMeteor.exe"
then
# aws s3 ls returns 0 when it lists nothing
if [[ $(aws s3 ls "s3://com.meteor.jenkins/$DIRNAME/InstallMeteor.exe" | wc -l) == 0 ]] then
echo "InstallMeteor.exe wasn't found in $DIRNAME, did Jenkins job fail?"
exit 1
fi

s3cmd -P cp -r "s3://com.meteor.jenkins/$DIRNAME/" "$TARGET$RELEASE/"
aws s3 cp --acl public-read --recursive "s3://com.meteor.jenkins/$DIRNAME/" "$TARGET$RELEASE/"

0 comments on commit 7a75453

Please sign in to comment.