| #!/bin/bash |
| |
| DEFAULT_TAG=${TAG:-$(date +v%Y.%m.%d.01)} |
| NO_BUCKD=1 |
| |
| DOWNLOAD_BASE="http://onlab.vicci.org/onos/third-party" |
| BUCK_ZIP="buck-$DEFAULT_TAG.zip" |
| ZIP_STAGE="buck-bin" |
| |
| rm -rf $ZIP_STAGE |
| |
| set -e |
| set -x |
| |
| # build plugins |
| |
| pushd buck |
| onos-buck build buck |
| popd #buck |
| |
| pushd onos |
| onos-buck build //tools/build/buck-plugin:onos |
| popd #onos |
| |
| pushd onos-yang-tools/compiler |
| mvn clean package |
| popd #onos-yang-tools |
| |
| # assemble zip |
| |
| mkdir -p buck-bin/plugins |
| |
| cp buck/buck-out/gen/programs/buck.pex $ZIP_STAGE/buck |
| cp onos/buck-out/gen/tools/build/buck-plugin/onos.jar $ZIP_STAGE/plugins/onos.jar |
| cp onos-yang-tools/compiler/plugin/buck/target/onos-yang-compiler-buck-plugin-*.jar $ZIP_STAGE/plugins/yang.jar |
| |
| BUCK_VERSION=$(buck/buck-out/gen/programs/buck.pex -V) |
| echo $BUCK_VERSION > $ZIP_STAGE/.buck_version |
| |
| chmod 555 $ZIP_STAGE/buck |
| chmod 444 $ZIP_STAGE/.buck_version |
| |
| pushd $ZIP_STAGE |
| zip -r ../$BUCK_ZIP buck .buck_version plugins |
| popd #$ZIP_STAGE |
| |
| if [ "$1" -ne "--dry-run" ]; then |
| # publish zip |
| #FIXME check for s3 credentials |
| uploadToS3.py --dest third-party/ $BUCK_ZIP |
| fi |
| |
| # update version in onos-buck |
| URL="$DOWNLOAD_BASE/$BUCK_ZIP" |
| SHA=$(shasum $BUCK_ZIP | cut -d' ' -f1) |
| |
| sed -i "" -E "s#BUCK_URL=.*#BUCK_URL=\"$URL\"#" onos/tools/build/onos-buck |
| sed -i "" -E "s#BUCK_SHA=.*#BUCK_SHA=\"$SHA\"#" onos/tools/build/onos-buck |
| |
| set +x |
| echo |
| echo "Commit and push change to onos-buck on the onos directory." |