Skip to content

Commit

Permalink
fix: do the renku-env after git credentials are configured
Browse files Browse the repository at this point in the history
  • Loading branch information
rokroskar committed Nov 11, 2020
1 parent 158d97a commit 5cb8fed
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions docker/py/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ if [ -z "$(git config --global --get user.email)" ]; then
git config --global user.email "$EMAIL"
fi

# configure global git credentials
if [[ -v CI_PROJECT ]];
then
# set the global git credentials
git config --global credential.helper "store --file=/work/${CI_PROJECT}/.git/credentials"

# link to the home work directory
ln -sf /work/${CI_PROJECT} ~/work
fi

#
# copy the environment from renku-env repo
#
Expand All @@ -22,15 +32,6 @@ git clone --depth 1 ${proto}${user}@${url}/${JUPYTERHUB_USER}/renku-env.git /tmp
# append the contents of all the files to same files in ${HOME}
find /tmp/renku-env -not -path '*.git*' -type f -print0 | xargs --null -I{} sh -c 'cat {} >> ${HOME}/$(basename "{}")' || true

if [[ -v CI_PROJECT ]];
then
# set the global git credentials
git config --global credential.helper "store --file=/work/${CI_PROJECT}/.git/credentials"

# link to the home work directory
ln -sf /work/${CI_PROJECT} ~/work
fi

# install git hooks
~/.local/bin/renku githooks install || true

Expand Down

0 comments on commit 5cb8fed

Please sign in to comment.