Skip to content

Commit

Permalink
CI/travis/lib.sh: make the build dir configurable
Browse files Browse the repository at this point in the history
This allows other scripts to specify a different build directory where
the scripts (that get downloaded) will be placed.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
  • Loading branch information
commodo committed Feb 12, 2019
1 parent f79c01b commit f24c618
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions CI/travis/lib.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/sh -e

export TRAVIS_API_URL="https://api.travis-ci.org"
LOCAL_BUILD_DIR=${LOCAL_BUILD_DIR:-build}

COMMON_SCRIPTS="jobs_running_cnt.py inside_docker.sh"

Expand All @@ -17,8 +18,8 @@ get_script_path() {
echo "CI/travis/$script"
elif [ -f "ci/travis/$script" ] ; then
echo "ci/travis/$script"
elif [ -f "build/$script" ] ; then
echo "build/$script"
elif [ -f "${LOCAL_BUILD_DIR}/$script" ] ; then
echo "${LOCAL_BUILD_DIR}/$script"
else
return 1
fi
Expand Down Expand Up @@ -295,9 +296,9 @@ ensure_command_exists sudo
for script in $COMMON_SCRIPTS ; do
[ ! -f "CI/travis/$script" ] || continue
[ ! -f "ci/travis/$script" ] || continue
[ ! -f "build/$script" ] || continue
mkdir -p build
[ ! -f "${LOCAL_BUILD_DIR}/$script" ] || continue
mkdir -p ${LOCAL_BUILD_DIR}
ensure_command_exists wget
wget https://raw.githubusercontent.com/analogdevicesinc/libiio/master/CI/travis/$script \
-O build/$script
-O $LOCAL_BUILD_DIR/$script
done

0 comments on commit f24c618

Please sign in to comment.