Clean up temporary files on exit

Change-Id: I3568c76529fe3f66a5d8b8e5bdaa365f56c589a8
diff --git a/tools/build/onos-buck-publish b/tools/build/onos-buck-publish
index d7d0202..f51de05 100755
--- a/tools/build/onos-buck-publish
+++ b/tools/build/onos-buck-publish
@@ -14,6 +14,8 @@
   echo "Created temp file for test artifact publish: $TEST_PUB" ||
   { echo "Failed to create temp file"; exit 1; }
 
+trap "rm -f $ARTIFACT_PUB $ARTIFACT_PUB.bak $TEST_PUB $TEST_PUB.bak" EXIT
+
 set -e
 set -x
 
diff --git a/tools/build/onos-buck-publish-local b/tools/build/onos-buck-publish-local
index 8bebeaa..d47f72d 100755
--- a/tools/build/onos-buck-publish-local
+++ b/tools/build/onos-buck-publish-local
@@ -4,6 +4,8 @@
 onos-buck -V
 
 rm -f /tmp/publish.sh
+trap "rm -f /tmp/publish.sh /tmp/publish.sh.bak" EXIT
+
 
 onos-buck query "kind('onos_jar', deps('//tools/package:onos-package'))" >> /tmp/publish.sh