Skip to content
Snippets Groups Projects
install-dependencies 1.33 KiB
Newer Older
#!/bin/sh

set -e

HG_GIT_REVISION="$HEPTAPOD_CI_HG_GIT_REVISION"  # may not be defined

set -u

# putting aside any hg-git checkout in a vendor/ subdirectory in
# order to be really, really sure not to create side effects
# on builds that really don't want an intermediate hg-git version to be in
# their way.
HG_GIT_LOCAL_REPO=vendor/hg-git
HG_GIT_REMOTE_REPO=https://foss.heptapod.net/mercurial/hg-git

if test -n "$HG_GIT_REVISION"; then
    if test -d "$HG_GIT_LOCAL_REPO"; then
        echo "Updating the hg-git clone found at $HG_GIT_LOCAL_REPO"
        hg -R $HG_GIT_LOCAL_REPO pull -r $HG_GIT_REVISION $HG_GIT_REMOTE_REPO
        hg -R $HG_GIT_LOCAL_REPO update -r $HG_GIT_REVISION
    else
        echo "Cloning hg-git to $HG_GIT_LOCAL_REPO"
        hg clone -r $HG_GIT_REVISION $HG_GIT_REMOTE_REPO $HG_GIT_LOCAL_REPO
    fi
    echo "pip-installing $HG_GIT_LOCAL_REPO"
    pip3 install --user -e $HG_GIT_LOCAL_REPO
fi

echo "pip-installing all missing requirements"
grep -v Mercurial install-requirements.txt > ci-install.reqs
# everything should already be in place for most builds but we can still
# have some version changes between rebuilds of the base images
pip3 install --user -r ci-install.reqs --upgrade
# Note: installing the whole of test-requirements.txt
# seems to create problems with
# what's already preinstalled in the CI Docker images