diff options
author | Sadaf Ebrahimi <sadafebrahimi@google.com> | 2022-09-19 21:26:21 +0000 |
---|---|---|
committer | Sadaf Ebrahimi <sadafebrahimi@google.com> | 2022-10-14 17:51:46 +0000 |
commit | 9d7cfa8217b3d5a501b3cf6b35511cc1f5a36948 (patch) | |
tree | 5d2b98a63d4f942bd3babd266cb81763bb59e1dc /pipeline/tools-lib.sh | |
parent | 912f8cc3fe4b53ebe8931f8f593e18a4f07c96b6 (diff) | |
download | rappor-9d7cfa8217b3d5a501b3cf6b35511cc1f5a36948.tar.gz |
Writing METADATA file for rappor
Also adding missing files that are upstream
Test: Treehugger
Change-Id: Ia4275b3a5d4d84196f6efc948bc57caf50151b60
Diffstat (limited to 'pipeline/tools-lib.sh')
-rwxr-xr-x | pipeline/tools-lib.sh | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/pipeline/tools-lib.sh b/pipeline/tools-lib.sh new file mode 100755 index 0000000..c7b3b24 --- /dev/null +++ b/pipeline/tools-lib.sh @@ -0,0 +1,64 @@ +#!/bin/bash +# +# Library used to refer to open source tools. + +set -o nounset +set -o pipefail +set -o errexit + +# NOTE: RAPPOR_SRC defined by the module that sources (cook.sh or ui.sh) + +# Caller can override shebang line by setting $DEP_PYTHON. +readonly PYTHON=${DEP_PYTHON:-} + +readonly METRIC_STATUS=${DEP_METRIC_STATUS:-} + + +# These 3 used by cook.sh. + +TOOLS-combine-status() { + if test -n "$PYTHON"; then + $PYTHON $RAPPOR_SRC/pipeline/combine_status.py "$@" + else + $RAPPOR_SRC/pipeline/combine_status.py "$@" + fi +} + +TOOLS-combine-results() { + if test -n "$PYTHON"; then + $PYTHON $RAPPOR_SRC/pipeline/combine_results.py "$@" + else + $RAPPOR_SRC/pipeline/combine_results.py "$@" + fi +} + +TOOLS-metric-status() { + if test -n "$METRIC_STATUS"; then + $METRIC_STATUS "$@" + else + $RAPPOR_SRC/pipeline/metric_status.R "$@" + fi +} + +# Used by ui.sh. + +TOOLS-csv-to-html() { + if test -n "$PYTHON"; then + $PYTHON $RAPPOR_SRC/pipeline/csv_to_html.py "$@" + else + $RAPPOR_SRC/pipeline/csv_to_html.py "$@" + fi +} + +# +# Higher level scripts +# + +TOOLS-cook() { + $RAPPOR_SRC/pipeline/cook.sh "$@" +} + +# TODO: Rename gen-ui.sh. +TOOLS-gen-ui() { + $RAPPOR_SRC/pipeline/ui.sh "$@" +} |