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/gce-entrypoint.sh

22 lines
545 B
Bash
Raw Normal View History

2019-03-12 10:18:14 +00:00
#!/usr/bin/env bash
2019-03-18 13:45:18 +00:00
set -o pipefail
set -o errtrace
set -o nounset
set -o errexit
2019-03-12 10:18:14 +00:00
2019-03-12 13:00:18 +00:00
if [ "$GCE_SSH_KEY" ]; then
echo "$GCE_SSH_KEY" > $HOME/.ssh/google_compute_engine
2019-03-12 10:18:14 +00:00
chmod 600 $HOME/.ssh/google_compute_engine
fi
2019-03-12 13:00:18 +00:00
if [ "$GCE_CREDENTIALS_JSON" ] && [ "$GCE_CREDENTIALS_FILE" ]; then
DIR=$(dirname "$GCE_CREDENTIALS_FILE")
2019-03-12 10:18:14 +00:00
mkdir -p "${DIR}"
2019-03-12 13:00:18 +00:00
echo "$GCE_CREDENTIALS_JSON" > "$GCE_CREDENTIALS_FILE"
2019-03-12 10:18:14 +00:00
fi
if [ "${MOLECULE_CUSTOM_MODULES_REPO}" ]; then
mkdir ./library/
2019-03-12 13:00:18 +00:00
git clone "$MOLECULE_CUSTOM_MODULES_REPO" ./library/
2019-03-12 10:18:14 +00:00
fi