Skip to content

Commit 68b4f1b

Browse files
authored
Add switch to quickstart.sh to provide a CLDR_COLLECTION_PATH for Cloudera collection developers to replace the default release version (#22)
Signed-off-by: Daniel Chaffelson <chaffelson@gmail.com>
1 parent 1e7cf41 commit 68b4f1b

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

quickstart.sh

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,16 @@ if [ ! -f "${HOME}"/.config/cloudera-deploy/profiles/default ]; then
5050
fi
5151
fi
5252

53+
# If CLDR_COLLECTION_PATH is set, the default version in the container will be removed and this path added to the Ansible Collection path
54+
# The path supplied must be relative to PROJECT_DIR
55+
if [ -n "${CLDR_COLLECTION_PATH}" ]; then
56+
echo "Path to custom Cloudera Collection supplied as ${CLDR_COLLECTION_PATH}, adding to Ansible Collection path"
57+
ANSIBLE_COLLECTIONS_PATH="/opt/cldr-runner/collections:/runner/project/${CLDR_COLLECTION_PATH}"
58+
else
59+
echo "Custom Cloudera Collection path not found"
60+
ANSIBLE_COLLECTIONS_PATH="/opt/cldr-runner/collections"
61+
fi
62+
5363
echo "Mounting ${PROJECT_DIR} to container as Project Directory /runner/project"
5464
echo "Creating Container ${CONTAINER_NAME} from image ${IMAGE_FULL_NAME}"
5565

@@ -73,7 +83,7 @@ if [ ! "$(docker ps -q -f name=${CONTAINER_NAME})" ]; then
7383
-e ANSIBLE_DEPRECATION_WARNINGS=false \
7484
-e ANSIBLE_HOST_KEY_CHECKING=false \
7585
-e ANSIBLE_SSH_RETRIES=10 \
76-
-e ANSIBLE_COLLECTIONS_PATH="/opt/cldr-runner/collections" \
86+
-e ANSIBLE_COLLECTIONS_PATH="${ANSIBLE_COLLECTIONS_PATH}" \
7787
-e ANSIBLE_ROLES_PATH="/opt/cldr-runner/roles" \
7888
--mount "type=bind,source=${HOME}/.aws,target=/home/runner/.aws" \
7989
--mount "type=bind,source=${HOME}/.config,target=/home/runner/.config" \
@@ -88,6 +98,10 @@ if [ ! "$(docker ps -q -f name=${CONTAINER_NAME})" ]; then
8898

8999
echo "Installing the cloudera-deploy project to the execution container '${CONTAINER_NAME}'"
90100
docker exec -td "${CONTAINER_NAME}" /usr/bin/env git clone https://github.com/cloudera-labs/cloudera-deploy.git /opt/cloudera-deploy --depth 1
101+
102+
if [ -n "${CLDR_COLLECTION_PATH}" ]; then
103+
docker exec -td "${CONTAINER_NAME}" /usr/bin/env rm -rf /opt/cldr-runner/collections/ansible_collections/cloudera
104+
fi
91105
fi
92106

93107
cat <<SSH_HOST_KEY

0 commit comments

Comments
 (0)