diff --git a/docker/services/swh-web/entrypoint.sh b/docker/services/swh-web/entrypoint.sh --- a/docker/services/swh-web/entrypoint.sh +++ b/docker/services/swh-web/entrypoint.sh @@ -5,16 +5,6 @@ source /srv/softwareheritage/utils/pgsql.sh setup_pgsql -# when overriding swh-web sources only -if [[ -d /src/swh-web ]] ; then - echo "Install and compile swh-web static assets" - pushd /src/swh-web - yarn install --frozen-lockfile - # execute webpack-dev-server in background - yarn start-dev& - popd -fi - source /srv/softwareheritage/utils/pyutils.sh setup_pip diff --git a/docker/utils/pyutils.sh b/docker/utils/pyutils.sh --- a/docker/utils/pyutils.sh +++ b/docker/utils/pyutils.sh @@ -1,6 +1,5 @@ #!/bin/bash - setup_pip () { echo Using pip from $(which pip) @@ -8,19 +7,23 @@ tmpdir=`mktemp -d` pushd /src for srcrepo in swh-* ; do - if [ -w $srcrepo ] - then - # Install package in editable mode if source directory is writable - pip install -e $srcrepo - else + if [ ! -w $srcrepo ]; then # Source directories might not be writeable, but building them writes # in-tree; so we're copying them to a location guaranteed to be writeable. rsync -a --chmod=+w $srcrepo $tmpdir/ --exclude "*/__pycache__/" --exclude "*/.tox/" --exclude "*/.hypothesis/" - pip install $tmpdir/$srcrepo + pushd $tmpdir/$srcrepo + else + pushd $srcrepo + fi + if [ -f package.json ]; then + yarn install --frozen-lockfile + yarn build-dev fi + # Install package in editable mode if source directory is writable + pip install -e . + popd done popd - rm -rf $tmpdir fi echo Installed Python packages: