From 3bbe116cbfbd10b3021ab9eb0e24c473e1af66ef Mon Sep 17 00:00:00 2001 From: Ronelle Landy Date: Thu, 23 Feb 2017 17:57:51 -0500 Subject: [PATCH] Add option to pass a config file with full path to collect-logs.sh The current script accepts only a single yaml file in one directory as a config that can contain documentation generation related variables. This review adds the option to pass the full path to the config file so that a custom file in any directory can be used for doc generation options. Closes-Bug: #1661657 Change-Id: I76bc8f560a5b06339c91609dcc781d376e820d7d --- ci-scripts/collect-logs.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/ci-scripts/collect-logs.sh b/ci-scripts/collect-logs.sh index 0c6cfb673..877824b15 100644 --- a/ci-scripts/collect-logs.sh +++ b/ci-scripts/collect-logs.sh @@ -23,6 +23,17 @@ export ANSIBLE_SSH_CONTROL_PATH=$socketdir/%%h-%%r export ARA_DATABASE="sqlite:///${WORKSPACE}/ara.sqlite" $WORKSPACE/bin/ara generate html $WORKSPACE/ara +# Check for existence of the config file in the default +# directory or as a full path +if [ -f $WORKSPACE/config/general_config/$CONFIG.yml ]; then + CONFIG_PATH=$WORKSPACE/config/general_config/$CONFIG.yml +elif [ -f $CONFIG ]; then + CONFIG_PATH=$CONFIG +else + echo "ERROR: Config file $CONFIG is not found." >&2 + exit 1 +fi + if [ "$JOB_TYPE" = "gate" ]; then VERIFY_SPHINX=true else @@ -34,7 +45,7 @@ bash quickstart.sh \ --no-clone \ --bootstrap \ --retain-inventory \ - --config $WORKSPACE/config/general_config/$CONFIG.yml \ + --config $CONFIG_PATH \ --playbook collect-logs.yml \ --extra-vars @$WORKSPACE/config/general_config/${LOG_ENV}-logs.yml \ --extra-vars artcl_verify_sphinx_build=$VERIFY_SPHINX \