From ee33b9336fa50d20d91bfabed2399ae0981efda5 Mon Sep 17 00:00:00 2001 From: Slava Kim Date: Fri, 16 Jan 2015 15:32:34 -0800 Subject: [PATCH] Script to copy windows installers from jenkins jobs --- .../copy-windows-installer-from-jenkins.sh | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 scripts/admin/copy-windows-installer-from-jenkins.sh diff --git a/scripts/admin/copy-windows-installer-from-jenkins.sh b/scripts/admin/copy-windows-installer-from-jenkins.sh new file mode 100755 index 0000000000..0c4b8c1ab2 --- /dev/null +++ b/scripts/admin/copy-windows-installer-from-jenkins.sh @@ -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/ +