blob: 01ed7d9e7ac70e21989dec1c72035f5f804a371f [file] [log] [blame]
Ray Milkey48256232017-07-19 15:09:10 -07001#!/bin/bash
2# -----------------------------------------------------------------------------
3# Build and publish the ONOS version of buck.
4# -----------------------------------------------------------------------------
5
6if [ $# -ne 3 -a $# -ne 4 ]; then
7 echo "Usage: buck-publish-setup buck-branch onos-branch yang-branch [version] [--dry-run]"
8 echo "For example, to build buck branch 11-11-2016, onos branch master, and onos-yang-tools master:"
9 echo "buck-publish 11-11-2016 master master"
10 exit 1
11fi
12
13if [ $# -eq 4 -a "${4}" != "--dry-run" ]; then
14 echo "$4 is an invalid parameter - only --dry-run allowed"
15 exit 1
16fi
17
18BUCK_BRANCH="$1"
19ONOS_BRANCH="$2"
20YANG_BRANCH="$3"
21
22if [ -z "$4" ]; then
23 onos-release-prerequisites
24fi
25
26DIR=$(mktemp -d /tmp/buck-publish.XXXXX) || { echo "Failed to create temp file"; exit 1; }
27
28buck-publish-setup $BUCK_BRANCH $ONOS_BRANCH $YANG_BRANCH $DIR
29pushd $DIR && buck-publish-package $4 && popd
Ray Milkey151af4b2018-01-10 14:27:41 -080030cp $DIR/onos/tools/build/onos-buck $ONOS_ROOT/tools/build/onos-buck
Ray Milkey48256232017-07-19 15:09:10 -070031
32