Commit 7c4d2ae1 authored by Evili del Rio's avatar Evili del Rio

Merge branch 'gitssh' into 'master'

Gitssh

See merge request evili/docker-django!1
parents 1dfc6979 330ce4ea
Pipeline #645 failed with stages
in 2 minutes and 8 seconds
...@@ -13,7 +13,7 @@ WORKDIR /app ...@@ -13,7 +13,7 @@ WORKDIR /app
RUN pip install --upgrade pip RUN pip install --upgrade pip
RUN apk update && \ RUN apk update && \
apk add bash \ apk add bash git openssh \
${lib_packages} \ ${lib_packages} \
${dev_packages} && \ ${dev_packages} && \
pip install gunicorn \ pip install gunicorn \
......
...@@ -22,6 +22,27 @@ else ...@@ -22,6 +22,27 @@ else
cd /app cd /app
fi fi
#
# Clone a git repo if configured
#
if [[ -n "${FIRST_RUN}" && "${GIT_REPO_URL}" ]]
then
if [[ -z "${GIT_SSH_KEY_FILE}" ]]
then
GIT_SSH_KEY_FILE=/Git_SSH_Key
fi
if [[ ! -s "${GIT_SSH_KEY_FILE}" && -n "${GIT_SSH_KEY}" ]]
then
echo ${GIT_SSH_KEY} > ${GIT_SSH_KEY_FILE}
chmod 600 ${GIT_SSH_KEY_FILE}
fi
if [[ -s ${GIT_SSH_KEY_FILE} ]]
then
export GIT_SSH_COMMAND="ssh -i ${GIT_SSH_KEY_FILE} -o PasswordAuthentication=no -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
fi
git clone ${GIT_REPO_URL} .
fi
if [[ -n "${FIRST_RUN}" && -n "${REQUIRED_PACKAGES}" ]] if [[ -n "${FIRST_RUN}" && -n "${REQUIRED_PACKAGES}" ]]
then then
apk update apk update
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment