diff options
author | Pavel Raiskup <praiskup@redhat.com> | 2014-10-22 13:56:12 +0200 |
---|---|---|
committer | Pavel Raiskup <praiskup@redhat.com> | 2014-10-22 13:56:12 +0200 |
commit | 858aba69d158c77502c879c8db3be6e811b0150d (patch) | |
tree | 1a60ed6c3350c1ec1955bbc5a09e28153fc56215 | |
parent | 346dc8cdb6c4b81ff2ee9b0d8c364895694641cb (diff) | |
download | postgresql-setup-tests-858aba69d158c77502c879c8db3be6e811b0150d.tar.gz postgresql-setup-tests-858aba69d158c77502c879c8db3be6e811b0150d.tar.xz postgresql-setup-tests-858aba69d158c77502c879c8db3be6e811b0150d.zip |
controller/commit_results: new helper script
.. to reuse remotely generated results and commit them to local
controller-database.
* commit_results: New script.
-rwxr-xr-x | controller/commit_results | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/controller/commit_results b/controller/commit_results new file mode 100755 index 0000000..f18a361 --- /dev/null +++ b/controller/commit_results @@ -0,0 +1,24 @@ +#!/bin/bash + +srcdir=$(cd -P -- "$(dirname -- "$0")" && pwd -P) || exit 1 +. "$srcdir/config/config.sh" || { + echo >&2 "sorry, but $srcdir/config/config.sh not found" + exit 1 +} + +# argparse +resultdir="$1" +ressubdir="$2" +test -n "$ressubdir" || { "no path specified" ; exit 1 ; } +test -n "$3" && DTF_DATABASE="$2" + +# checks +test -z "$DTF_DATABASE" && exit 1 +test -f "$resultdir/dtf.tar.gz" || exit 1 + +# run +if test ! -d "$DTF_DATABASE/$ressubdir"; then + mkdir -p "$DTF_DATABASE/$ressubdir" +fi + +( cd "$resultdir" && tar -xf dtf.tar.gz && cp -r dtf "$DTF_DATABASE/$ressubdir" ) |