This repository has been archived on 2024-08-19. You can view files and clone it, but cannot push or open issues or pull requests.
molecule/overlay/bin/molecule
2020-02-20 17:24:52 +01:00

25 lines
668 B
Bash
Executable File

#!/usr/bin/env sh
set -eo pipefail
DIR=$(pwd)
LIBRARY_DIR=${DIR%/}/library/
FILTERS_DIR=${DIR%/}/plugins/filters/
if [ "${MOLECULE_CUSTOM_MODULES_REPO}" ]; then
echo "Cloning custom modules..."
[ -d "${iLIBRARY_DIR}" ] && rm -rf "${LIBRARY_DIR}"
mkdir -p "${LIBRARY_DIR}"
git clone "${MOLECULE_CUSTOM_MODULES_REPO}" "{LIBRARY_DIR}" 2> /dev/null
echo
fi
if [ "${MOLECULE_CUSTOM_FILTERS_REPO}" ]; then
echo "Cloning custom filters..."
[ -d "${FILTERS_DIR}" ] && rm -rf "${FILTERS_DIR}"
mkdir -p "${FILTERS_DIR}"
git clone "$MOLECULE_CUSTOM_FILTERS_REPO" "${FILTERS_DIR}" 2> /dev/null
echo
fi
exec /usr/local/bin/molecule "$@"