Skip to content
This repository was archived by the owner on Jun 30, 2024. It is now read-only.

Commit 479ff65

Browse files
authored
Merge pull request #1962 from bjones1/bookserver-path
Bookserver path
2 parents 8013050 + 3d0d7cf commit 479ff65

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,9 @@ ENV DOCKER_BUILD_ARGS=${DOCKER_BUILD_ARGS}
1919
# Define some ARGs which could be passed into while building.
2020
#
2121
# **Warning:** Changing this path will require changes in many other places: the Docker volume locations, the paths in ``pyproject.toml``, paths used to run tests, etc.
22-
ARG WEB2PY_PATH=/srv/web2py
23-
# And export some as env vars so they could be available at run time
24-
ENV WEB2PY_PATH=${WEB2PY_PATH}
22+
ENV WEB2PY_PATH=/srv/web2py
2523
ENV RUNESTONE_PATH=${WEB2PY_PATH}/applications/runestone
24+
ENV BOOK_SERVER_PATH=/srv/BookServer
2625

2726
# Click needs these encodings for Python 3.
2827
ENV LC_ALL=C.UTF-8

docker/docker_tools.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
# Local application bootstrap
6868
# ---------------------------
6969
# Everything after this depends on Unix utilities. We can't use ``is_win`` because we don't know if ``ci_utils`` is available.
70-
if sys.platform == "win32x":
70+
if sys.platform == "win32":
7171
sys.exit("ERROR: You must run this program in WSL/VirtualBox/VMWare/etc.")
7272

7373
# See if we're root.
@@ -816,7 +816,8 @@ def _build_phase_1(
816816
# ``sphinxcontrib.paverutils.run_sphinx`` lacks venv support -- it doesn't use ``sys.executable``, so it doesn't find ``sphinx-build`` in the system path when executing ``/srv/venv/bin/runestone`` directly, instead of activating the venv first (where it does work). As a huge, ugly hack, symlink it to make it available in the system path.
817817
"ln -sf $RUNESTONE_PATH/.venv/bin/sphinx-build /usr/local/bin",
818818
# Deal with a different subdirectory layout inside the container (mandated by web2py) and outside the container by adding these symlinks.
819-
"ln -sf /srv/BookServer $WEB2PY_PATH/applications/BookServer",
819+
"ln -sf $BOOK_SERVER_PATH $WEB2PY_PATH/applications/BookServer",
820+
# We can't use ``$BOOK_SERVER_PATH`` here, since we need ``/srv/bookserver-dev`` in lowercase, not CamelCase.
820821
"ln -sf /srv/bookserver-dev $WEB2PY_PATH/applications/bookserver-dev",
821822
"ln -sf /srv/RunestoneComponents $WEB2PY_PATH/applications/RunestoneComponents",
822823
"ln -sf /srv/runestone-dev $WEB2PY_PATH/applications/runestone-dev",

docker/docker_tools_misc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ def test(bks: bool, rc: bool, rs: bool, passthrough: Tuple) -> None:
201201
pytest = "$RUNESTONE_PATH/.venv/bin/pytest"
202202
passthrough_args = " ".join(passthrough)
203203
if bks:
204-
xqt(f"{pytest} -v {passthrough_args}", cwd="/srv/BookServer")
204+
xqt(f"{pytest} -v {passthrough_args}", cwd=env.BOOK_SERVER_PATH)
205205
if rc:
206206
xqt(f"{pytest} -v {passthrough_args}", cwd="/srv/RunestoneComponents")
207207
if rs:

docker/gunicorn_config/fastapi_config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020
#
2121
# Local application imports
2222
# -------------------------
23-
from common_config import *
23+
from common_config import * # noqa: F401, F403
2424

2525

2626
# Configuration
2727
# =============
2828
# `chdir <https://docs.gunicorn.org/en/stable/settings.html#chdir>`_: Change directory to specified directory before loading apps. Otherwise gunicorn does not know where to look for changes to your code.
2929
if os.environ["BOOK_SERVER_CONFIG"] == "development":
30-
chdir = "/srv/BookServer"
30+
chdir = os.environ["BOOK_SERVER_PATH"]
3131

3232
# `wsgi_app <https://docs.gunicorn.org/en/stable/settings.html#wsgi-app>`_: A WSGI application path in pattern ``$(MODULE_NAME):$(VARIABLE_NAME)``.
3333
wsgi_app = "bookserver.main:app"

0 commit comments

Comments
 (0)