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
Robert Kaussow 54f309d432
All checks were successful
continuous-integration/drone/push Build is passing
rework molecule wrapper
2020-02-20 23:24:46 +01:00

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 "$@"