blob: aa56dea966db267d1503fbf48265d43d50358afe [file] [log] [blame]
#!/bin/bash
#
# Script that queries buck for main and test artifacts and publishes them to
# a remote Maven repository. Main artifacts are published with javadoc and sources
# jars and auto-generated pom.xml files. Test artifacts are published as compiled
# jars only. All artifacts are signed.
#
ARTIFACT_PUB=$(mktemp /tmp/onos-publish.XXXXX) &&
echo "Created temp file for artifact publish: $ARTIFACT_PUB" ||
{ echo "Failed to create temp file"; exit 1; }
TEST_PUB=$(mktemp /tmp/onos-publish-tests.XXXXX) &&
echo "Created temp file for test artifact publish: $TEST_PUB" ||
{ echo "Failed to create temp file"; exit 1; }
set -e
set -x
# Prepare artifact publish commands
onos-buck query "kind('onos_jar', deps('//tools/package:onos-package'))" >> $ARTIFACT_PUB
onos-buck query "filter('.*-oar', deps('//tools/package:onos-package', 1))" >> $ARTIFACT_PUB
echo "//tools/package:onos-features" >> $ARTIFACT_PUB
sed -i.bak 's/^/onos-buck publish --to-maven-central --include-source --include-javadoc --sign /g' $ARTIFACT_PUB
# Print commands to be run and then run them
cat $ARTIFACT_PUB
bash $ARTIFACT_PUB
# Prepare test publish commands
onos-buck query "testsof(kind('onos_jar', deps('//tools/package:onos-package')))" >> $TEST_PUB
sed -i.bak 's#^#onos-buck publish --to-maven-central --sign #g' $TEST_PUB
# Print commands to be run and then run them
cat $TEST_PUB
bash $TEST_PUB
# Close the staging area
onos-close-staging