Script to copy windows installers from jenkins jobs

This commit is contained in:
Slava Kim
2015-01-16 15:32:34 -08:00
committed by Sashko Stubailo
parent 9d1c10aae2
commit ee33b9336f

View File

@@ -0,0 +1,37 @@
#!/bin/bash
# Requires s3cmd to be installed and an appropriate ~/.s3cfg.
# Usage:
# scripts/admin/copy-windows-installer-from-jenkins.sh BUILDNUMBER
# where BUILDNUMBER is the small integer Jenkins build number.
set -e
set -u
cd "`dirname "$0"`"
TARGET="s3://meteor-windows/installers/"
if [ $# -ne 1 ]; then
echo "usage: $0 jenkins-build-number" 1>&2
exit 1
fi
DIRNAME=$(s3cmd 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
echo "build not found" 1>&2
exit 1
fi
echo Found build $DIRNAME
if ! s3cmd info s3://com.meteor.jenkins/$DIRNAME/InstallMeteor.exe
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/