to prevent permission issues.
Depends on D7492
Differential D7493
docker: make yarn run in the local copy of the swh-web source code douardda on Apr 4 2022, 2:06 PM. Authored by
Details
to prevent permission issues. Depends on D7492
Diff Detail
Event Timeline
Comment Actions So I made some tests today to fix the infinite reloading of the webapp in browser when overriding swh-web sources and when the source directory is writable. Also the assets compilation must happen after having installed the swh-web Python package or a full install So I came out with the following patch to apply to the current state of the diff: diff --git a/docker/utils/pyutils.sh b/docker/utils/pyutils.sh index a679640..3533adb 100755 --- a/docker/utils/pyutils.sh +++ b/docker/utils/pyutils.sh @@ -15,12 +15,22 @@ setup_pip () { else pushd $srcrepo fi + # Install package in editable mode if source directory is writable + pip install -e . + # swh-web special case to handle frontend assets compilation if [ -f package.json ]; then yarn install --frozen-lockfile - yarn build-dev + if [ ! -w . ]; then + # swh-web source directory is not writable, there is no interest to + # use webpack-dev-server as we made a copy of assets source files, + # simply compile the assets then + yarn build-dev + else + # webpack-dev-server can be used, web application will be automatically + # reloaded in the browser when modifying assets sources (js, css, ...) + yarn start-dev& + fi fi - # Install package in editable mode if source directory is writable - pip install -e . popd done popd
|