Robert Kaussow
54f309d432
All checks were successful
continuous-integration/drone/push Build is passing
25 lines
779 B
Bash
Executable File
25 lines
779 B
Bash
Executable File
#!/usr/bin/env sh
|
|
set -eo pipefail
|
|
|
|
DIR=$(pwd)
|
|
[ -z "${MOLECULE_LIBRARY_DIR}" ] && MOLECULE_LIBRARY_DIR=${DIR%/}/library
|
|
[ -z "${MOLECULE_PLUGINS_DIR}" ] && MOLECULE_PLUGINS_DIR=${DIR%/}/plugins
|
|
|
|
if [ -n "${MOLECULE_CUSTOM_MODULES_REPO}" ]; then
|
|
printf "Cloning custom modules ...\n"
|
|
WORKDIR="${MOLECULE_LIBRARY_DIR}"
|
|
[ -d "$WORKDIR" ] && rm -rf "$WORKDIR"
|
|
mkdir -p "$WORKDIR"
|
|
git clone "$MOLECULE_CUSTOM_MODULES_REPO" "$WORKDIR" 2> /dev/null
|
|
fi
|
|
|
|
if [ -n "${MOLECULE_CUSTOM_FILTERS_REPO}" ]; then
|
|
WORKDIR="${MOLECULE_PLUGINS_DIR}/filter"
|
|
printf "Cloning custom filters ...\n"
|
|
[ -d "$WORKDIR" ] && rm -rf "$WORKDIR"
|
|
mkdir -p "$WORKDIR"
|
|
git clone "$MOLECULE_CUSTOM_FILTERS_REPO" "$WORKDIR" 2> /dev/null
|
|
fi
|
|
|
|
exec /usr/local/bin/molecule "$@"
|