VRFS-951 Pushing only develop or master branch files as debians

This commit is contained in:
Chris Doughty 2014-01-05 21:35:22 -06:00
parent 18d8ff8d3f
commit d8cb2c72c4
4 changed files with 60 additions and 47 deletions

View File

@ -9,17 +9,21 @@ if [ "$?" = "0" ]; then
echo "build succeeded"
if [ ! -z "$PACKAGE" ]; then
echo "publishing ubuntu package (.deb)"
DEBPATH=`find target/deb -name *.deb`
DEBNAME=`basename $DEBPATH`
if [[ "$GIT_BRANCH" == *develop* || "$GIT_BRANCH" == *master* ]]; then
echo "publishing ubuntu package (.deb)"
DEBPATH=`find target/deb -name *.deb`
DEBNAME=`basename $DEBPATH`
curl -f -T $DEBPATH $DEB_SERVER/$DEBNAME
curl -f -T $DEBPATH $DEB_SERVER/$DEBNAME
if [ "$?" != "0" ]; then
echo "deb publish failed"
exit 1
if [ "$?" != "0" ]; then
echo "deb publish failed"
exit 1
fi
echo "done publishing deb"
else
echo "Skipping publish since branch is neither master or develop..."
fi
echo "done publishing deb"
fi
else
echo "build failed"

View File

@ -7,38 +7,39 @@ 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"
echo "build succeeded"
if [[ "$GIT_BRANCH" == *develop* || "$GIT_BRANCH" == *master* ]]; then
echo "publishing gem"
pushd "target/ruby_package"
find . -name *.gem -exec curl -f -T {} $GEM_SERVER/{} \;
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
if [ "$?" != "0" ]; then
echo "publish failed"
exit 1
fi
echo "done publishing debs"
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 "Skipping publish since branch is neither master or develop..."
fi
else
echo "build failed"
exit 1
fi

View File

@ -9,17 +9,21 @@ if [ "$?" = "0" ]; then
echo "build succeeded"
if [ ! -z "$PACKAGE" ]; then
echo "publishing ubuntu package (.deb)"
DEBPATH=`find target/deb -name *.deb`
DEBNAME=`basename $DEBPATH`
if [[ "$GIT_BRANCH" == *develop* || "$GIT_BRANCH" == *master* ]]; then
echo "publishing ubuntu package (.deb)"
DEBPATH=`find target/deb -name *.deb`
DEBNAME=`basename $DEBPATH`
curl -f -T $DEBPATH $DEB_SERVER/$DEBNAME
curl -f -T $DEBPATH $DEB_SERVER/$DEBNAME
if [ "$?" != "0" ]; then
echo "deb publish failed"
exit 1
if [ "$?" != "0" ]; then
echo "deb publish failed"
exit 1
fi
echo "done publishing deb"
else
echo "Skipping publish since branch is neither master or develop..."
fi
echo "done publishing deb"
fi
else
echo "build failed"

View File

@ -9,6 +9,8 @@ echo "starting build..."
if [ "$?" = "0" ]; then
echo "build succeeded"
if [[ "$GIT_BRANCH" == *develop* || "$GIT_BRANCH" == *master* ]]; then
# generate gem version based on jenkins build number
if [ -z $BUILD_NUMBER ]; then
BUILD_NUMBER="1"
@ -20,14 +22,14 @@ module JamWebsockets
VERSION = "$VERSION"
end
EOF
gem build jam_websockets.gemspec
GEMNAME="jam_websockets-${VERSION}.gem"
echo "publishing gem"
curl -f -T $GEMNAME $GEM_SERVER/$GEMNAME
if [ "$?" != "0" ]; then
echo "gem publish failed"
exit 1
@ -47,8 +49,10 @@ EOF
fi
echo "done publishing deb"
fi
else
echo "Skipping publish since branch is neither master or develop..."
fi
else
echo "build failed"
exit 1