From 30322dd4cb3161ba766546bc9993ced17701b4b3 Mon Sep 17 00:00:00 2001 From: Brian O'Connor Date: Mon, 14 Aug 2017 19:11:29 -0700 Subject: [PATCH] Fixing tar_file and proxy-stc Change-Id: I51ee55151975ba22d168ccad58efe92d55acd9e1 --- BUCK | 1 + bucklets/onos.bucklet | 11 ++++++++--- tools/package/BUCK | 8 ++++++++ tools/test/bin/proxy-stc | 4 +++- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/BUCK b/BUCK index dec82d9873..b5c753784a 100644 --- a/BUCK +++ b/BUCK @@ -55,6 +55,7 @@ tar_file( 'tools/dev/bin/onos-create-app', 'tools/build/envDefaults' ], + other_tars = [ '//tools/package:onos-package-runtime' ], ) only_lib_dep_pom( diff --git a/bucklets/onos.bucklet b/bucklets/onos.bucklet index d6eb053c80..03b13a96db 100644 --- a/bucklets/onos.bucklet +++ b/bucklets/onos.bucklet @@ -313,14 +313,19 @@ def osgi_jar_with_tests( def tar_file( name, srcs, + other_tars = [], root = None, out = None, visibility = [ 'PUBLIC' ], ): - cmd = ( 'mkdir -p $TMP/%(root_dir)s && ' - 'cp -R -L $SRCDIR/* $TMP/%(root_dir)s && ' - 'tar -C $TMP -zcf $OUT %(root_dir)s' ) % { + cmds = [ 'mkdir -p $TMP/%(root_dir)s', + 'cp -R -L $SRCDIR/* $TMP/%(root_dir)s' ] + for t in other_tars: + cmds += [ 'tar -zxf $(location %s)' % t + ' -C $TMP/%(root_dir)s' ] + cmds += [ 'tar -C $TMP -zcf $OUT %(root_dir)s' ] + + cmd = ' && '.join(cmds) % { 'root_dir': root if root is not None else name } diff --git a/tools/package/BUCK b/tools/package/BUCK index 4e8ab7e0eb..8f429c9eae 100644 --- a/tools/package/BUCK +++ b/tools/package/BUCK @@ -39,6 +39,14 @@ staged_apps = ['$(location %s)' % a for a in APPS] sources = [ '$(location :onos-features)', ] sources += staged_repos + staged_apps +tar_file( + name = 'onos-package-runtime', + srcs = glob(['runtime/bin/*']), + root = 'tools/package', + out = 'package-runtime.tar.gz', + visibility = [ 'PUBLIC' ], +) + genrule( name = 'onos-package', srcs = glob(['bin/*', 'etc/*', 'init/*', 'config/*', 'runtime/bin/*']), diff --git a/tools/test/bin/proxy-stc b/tools/test/bin/proxy-stc index af264d0a60..ac840e469b 100755 --- a/tools/test/bin/proxy-stc +++ b/tools/test/bin/proxy-stc @@ -32,9 +32,11 @@ ssh -t -t $ONOS_USER@$OCT " topo default export stcDumpLogs=true export stcColor=$stcColor - stc fast + stc $1 " +status=$? mkdir -p /tmp/stc scp -r ${ONOS_USER}@${OCT}:/tmp/stc/* /tmp/stc/ +exit $status \ No newline at end of file