Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

executable file 54 lines (42 sloc) 1.179 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
#!/bin/bash

if ([ "X$1" == "X--help" ] || [ "X$1" == "X-h" ]); then
    echo "Usage:"
    echo "broker-make-dist.sh [<destination directory>] [<git repository>]"
    echo "Default: make-dist . git://github.com/nimbusproject/nimbus.git"
    exit 0
fi

if [ "X$2" != "X" ]; then
# normalize dir, otherwise it is relative to $co_dir
    dest_dir=`cd "$1";pwd`
else
    dest_dir=`pwd`
fi

if [ "X$2" != "X" ]; then
    repo=$2
else
    repo="git://github.com/nimbusproject/nimbus.git"
fi

co_dir=`mktemp -d -t tmp.XXXXXXXXXX`

echo "Destination directory: $dest_dir"
echo "Nimbus git repository: $repo"
echo "Created temp directory: $co_dir"

cd $co_dir
git clone $repo

cd $co_dir/nimbus
ant -f scripts/lib/gt4.0/dist/build.xml clean
ant -f scripts/lib/gt4.0/brokerdist/build.xml clean-local
ant -f scripts/lib/gt4.0/brokerdist/build.xml create-dist
if [ $? -ne 0 ]; then
    echo "create-dist failed"
    exit 1
fi

ls scripts/lib/gt4.0/brokerdist/result/

cd scripts/lib/gt4.0/brokerdist/result/

cp *.tar.gz $dest_dir
if [ $? -ne 0 ]; then
    echo "copy failed"
    exit 1
fi

echo "Removing temp dir: $co_dir"
rm -rf $co_dir

echo "Finished. Tarballs copied to $dest_dir."
Something went wrong with that request. Please try again.