Ray Milkey | 4825623 | 2017-07-19 15:09:10 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # ----------------------------------------------------------------------------- |
| 3 | # Build and publish the ONOS version of buck. |
| 4 | # ----------------------------------------------------------------------------- |
| 5 | |
| 6 | if [ $# -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 |
| 11 | fi |
| 12 | |
| 13 | if [ $# -eq 4 -a "${4}" != "--dry-run" ]; then |
| 14 | echo "$4 is an invalid parameter - only --dry-run allowed" |
| 15 | exit 1 |
| 16 | fi |
| 17 | |
| 18 | BUCK_BRANCH="$1" |
| 19 | ONOS_BRANCH="$2" |
| 20 | YANG_BRANCH="$3" |
| 21 | |
| 22 | if [ -z "$4" ]; then |
| 23 | onos-release-prerequisites |
| 24 | fi |
| 25 | |
| 26 | DIR=$(mktemp -d /tmp/buck-publish.XXXXX) || { echo "Failed to create temp file"; exit 1; } |
| 27 | |
| 28 | buck-publish-setup $BUCK_BRANCH $ONOS_BRANCH $YANG_BRANCH $DIR |
| 29 | pushd $DIR && buck-publish-package $4 && popd |
Ray Milkey | 151af4b | 2018-01-10 14:27:41 -0800 | [diff] [blame] | 30 | cp $DIR/onos/tools/build/onos-buck $ONOS_ROOT/tools/build/onos-buck |
Ray Milkey | 4825623 | 2017-07-19 15:09:10 -0700 | [diff] [blame] | 31 | |
| 32 | |