[FIX] runbot: append user bin dir to pre commands

When pip installs a package that contains a script, it goes in
`~/.local/bin` directory of the current user. This leads to a log warning
to warn the user that the script won't be accessible by other users.

e.g.:
`WARNING: The script pygmentize is installed in '/home/odoo/.local/bin'
which is not on PATH.`

This is particularly annoying for documentation builds because it may
confuse the users.

Also, it means that when a locally installed pip package overrides a
python package installed system wide (e.g.: by apt-get), it's still
globally script that runs when called.

With this commit, the user PATH is updated to include this local bin
directory when building Docker images.
This commit is contained in:
Christophe Monniez 2023-03-09 10:26:01 +01:00
parent 6fdd35ed50
commit 8b3b53bd56

View File

@ -126,6 +126,7 @@ class Host(models.Model):
&& mkdir /home/{user} \\
&& chown -R {user}:{user} /home/{user}
USER {user}
ENV PATH /home/{user}/.local/bin:$PATH
ENV COVERAGE_FILE /data/build/.coverage
"""