blob: 01ed7d9e7ac70e21989dec1c72035f5f804a371f [file] [log] [blame]
#!/bin/bash
# -----------------------------------------------------------------------------
# Build and publish the ONOS version of buck.
# -----------------------------------------------------------------------------
if [ $# -ne 3 -a $# -ne 4 ]; then
echo "Usage: buck-publish-setup buck-branch onos-branch yang-branch [version] [--dry-run]"
echo "For example, to build buck branch 11-11-2016, onos branch master, and onos-yang-tools master:"
echo "buck-publish 11-11-2016 master master"
exit 1
fi
if [ $# -eq 4 -a "${4}" != "--dry-run" ]; then
echo "$4 is an invalid parameter - only --dry-run allowed"
exit 1
fi
BUCK_BRANCH="$1"
ONOS_BRANCH="$2"
YANG_BRANCH="$3"
if [ -z "$4" ]; then
onos-release-prerequisites
fi
DIR=$(mktemp -d /tmp/buck-publish.XXXXX) || { echo "Failed to create temp file"; exit 1; }
buck-publish-setup $BUCK_BRANCH $ONOS_BRANCH $YANG_BRANCH $DIR
pushd $DIR && buck-publish-package $4 && popd
cp $DIR/onos/tools/build/onos-buck $ONOS_ROOT/tools/build/onos-buck