blob: e319395d771d48471caba676a3cf719e0d81e25e [file] [log] [blame]
Brian O'Connord27d4372016-10-12 15:06:21 -07001#!/bin/bash
2
3BUCK_LOCAL_CONFIG=${BUCK_LOCAL_CONFIG:-$ONOS_ROOT/.buckconfig.local}
4MVN_REPO="https://oss.sonatype.org/content/repositories/snapshots"
5NO_BUCKD=1
6
7set -e
8set -x
9
10#FIXME if pwd != buck
11pushd buck
12
13# build buck
14scripts/create_tag.sh
15buck build buck --show-output
16
17# publish cli:main-fixed as buck-api
18cp $BUCK_LOCAL_CONFIG .
19buck publish //src/com/facebook/buck/cli:main-fixed \
20 --remote-repo=https://oss.sonatype.org/content/repositories/snapshots/ \
21 | tee ../api-publish.txt
22
23# Alternatively, we can deploy org.onosproject:buck-api with the following:
24#mvn deploy:deploy-file -DgroupId=org.onosproject -DartifactId=buck-api \
25# -Dversion=0.1-SNAPSHOT -DgeneratePom=true -Dpackaging=jar \
26# -DrepositoryId=snapshot -Durl=https://oss.sonatype.org/content/repositories/snapshots/ \
27# -Dfile=buck-out/gen/src/com/facebook/buck/cli/main-fixed/main-fixed.jar
28
29#FIXME upload API to S3 for backup
30
31popd #buck
32
33SNAPSHOT_VERSION=$(cat api-publish.txt | grep "^org.onosproject:buck-api:jar" \
34 | cut -d' ' -f1 | cut -d: -f4)
35BUCK_API_URL="$MVN_REPO/org/onosproject/buck-api/0.1-SNAPSHOT/buck-api-$SNAPSHOT_VERSION.jar"
36echo $BUCK_API_URL
37
38BUCK_API_SHA=$(shasum buck-out/gen/src/com/facebook/buck/cli/main-fixed/main-fixed.jar | cut -d' ' -f1)
39echo $BUCK_API_SHA
40
41pushd onos
42sed -i "" -E "s#url =.*#url = '$BUCK_API_URL',#" tools/build/buck-plugin/BUCK
43sed -i "" -E "s#sha1 =.*#sha1 = '$BUCK_API_SHA',#" tools/build/buck-plugin/BUCK
44popd #onos
45
46#pushd onos-yang-tools
47#FIXME update version (assume 0.1-SNAPSHOT for now)
48#popd #onos-yang-tools
49
50set +x
51
52echo
53echo "Please build and verify the ONOS Buck plugin and the Yang tools plugin:"
54echo " cd onos; buck build //tools/build/buck-plugin:onosjar"
55echo " cd onos-yang-tools; mvn clean package"
56echo "You should commit and push any required changes."