| DEFAULT_TAG=${TAG:-$(date +v%Y.%m.%d.01)} |
| DOWNLOAD_BASE="http://onlab.vicci.org/onos/third-party" |
| BUCK_ZIP="buck-$DEFAULT_TAG.zip" |
| onos-buck build //tools/build/buck-plugin:onos |
| 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 |
| zip -r ../$BUCK_ZIP buck .buck_version plugins |
| if [ "$1" != "--dry-run" ]; then |
| #FIXME check for s3 credentials |
| uploadToS3.py --dest third-party/ $BUCK_ZIP |
| # 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 |
| echo "Commit and push change to onos-buck on the onos directory." |