File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed
Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change 6363echo " Mounting ${PROJECT_DIR} to container as Project Directory /runner/project"
6464echo " Creating Container ${CONTAINER_NAME} from image ${IMAGE_FULL_NAME} "
6565
66+ echo " Checking OS"
67+ if [ ! -f " /run/host-services/ssh-auth.sock" ];
68+ then
69+ if [ ! -z " $SSH_AUTH_SOCK " ];
70+ then
71+ SSH_AUTH_SOCK=${SSH_AUTH_SOCK}
72+ else
73+ echo " SSH_AUTH_SOCK is empty or not set, unable to proceed. Exiting"
74+ exit -1
75+ fi
76+ else
77+ SSH_AUTH_SOCK=${SSH_AUTH_SOCK}
78+ fi
79+
80+ echo " SSH authentication for container taken from ${SSH_AUTH_SOCK} "
81+
6682if [ ! " $( docker ps -q -f name=${CONTAINER_NAME} ) " ]; then
6783 if [ " $( docker ps -aq -f status=exited -f name=${CONTAINER_NAME} ) " ]; then
6884 # cleanup if exited
@@ -74,7 +90,7 @@ if [ ! "$(docker ps -q -f name=${CONTAINER_NAME})" ]; then
7490 docker run -td \
7591 --detach-keys=" ctrl-@" \
7692 -v " ${PROJECT_DIR} " :/runner/project \
77- --mount type=bind,src=/run/host-services/ssh-auth.sock ,target=/run/host-services/ssh-auth.sock \
93+ --mount type=bind,src=${SSH_AUTH_SOCK} ,target=/run/host-services/ssh-auth.sock \
7894 -e SSH_AUTH_SOCK=" /run/host-services/ssh-auth.sock" \
7995 -e ANSIBLE_LOG_PATH=" /home/runner/.config/cloudera-deploy/log/${CLDR_BUILD_VER:- latest} -$( date +%F_%H%M%S) " \
8096 -e ANSIBLE_INVENTORY=" inventory" \
@@ -120,4 +136,4 @@ echo 'Quickstart? Run this command -- ansible-playbook /opt/cloudera-deploy/main
120136docker exec \
121137 --detach-keys=" ctrl-@" \
122138 -it " ${CONTAINER_NAME} " \
123- /usr/bin/env bash
139+ /usr/bin/env bash
You can’t perform that action at this time.
0 commit comments