45 lines
944 B
Bash
Executable File
45 lines
944 B
Bash
Executable File
#!/bin/bash
|
|
|
|
GEM_SERVER=http://localhost:9000/gems
|
|
DEB_SERVER=http://localhost:9010/apt-`uname -p`
|
|
|
|
echo "starting build..."
|
|
./build
|
|
|
|
if [ "$?" = "0" ]; then
|
|
echo "build succeeded"
|
|
echo "publishing gem"
|
|
pushd "target/ruby_package"
|
|
find . -name *.gem -exec curl -f -T {} $GEM_SERVER/{} \;
|
|
|
|
if [ "$?" != "0" ]; then
|
|
echo "publish failed"
|
|
exit 1
|
|
fi
|
|
popd
|
|
echo "done publishing gems"
|
|
|
|
if [ ! -z "$PACKAGE" ]; then
|
|
echo "publishing ubuntu packages (.deb)"
|
|
for f in `find target -name '*.deb'`; do
|
|
DEBNAME=`basename $f`
|
|
DEBPATH="$f"
|
|
echo "publishing $DEBPATH to deb server"
|
|
curl -f -T $DEBPATH $DEB_SERVER/$DEBNAME
|
|
|
|
if [ "$?" != "0" ]; then
|
|
echo "deb publish failed of $DEBPATH"
|
|
exit 1
|
|
fi
|
|
done
|
|
|
|
echo "done publishing debs"
|
|
fi
|
|
|
|
else
|
|
echo "build failed"
|
|
exit 1
|
|
fi
|
|
|
|
|