diff --git a/.gitignore b/.gitignore index def55fe027..c5b47046e5 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,7 @@ zuul/versioninfo dist/ cover/ htmlcov/ +web/build zuul/web/static/* !.keep node_modules diff --git a/Dockerfile b/Dockerfile index ed6b8ddf2b..015e4ef4d9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,7 +27,12 @@ ARG OPENSHIFT_SHA=4b0f07428ba854174c58d2e38287e5402964c9a9355f6c359d1242efd0990d COPY . /tmp/src RUN /tmp/src/tools/install-js-tools.sh # Explicitly run the Javascript build -RUN cd /tmp/src/web && yarn install -d && yarn build +RUN cd /tmp/src \ + && mkdir -p zuul/web/static \ + && ln -sfn ../zuul/web/static web/build \ + && cd /tmp/src/web \ + && yarn install -d \ + && yarn build RUN assemble # The wheel install method doesn't run the setup hooks as the source based diff --git a/tools/pip.sh b/tools/pip.sh index dde6a19b37..de9724f4e9 100755 --- a/tools/pip.sh +++ b/tools/pip.sh @@ -39,6 +39,8 @@ then fi if [[ ! -f zuul/web/static/status.html ]] then + mkdir -p zuul/web/static + ln -sfn ../zuul/web/static web/build pushd web/ yarn install yarn build diff --git a/web/build b/web/build deleted file mode 120000 index 45dc67777c..0000000000 --- a/web/build +++ /dev/null @@ -1 +0,0 @@ -../zuul/web/static/ \ No newline at end of file diff --git a/zuul/_setup_hook.py b/zuul/_setup_hook.py index d88815c36f..38eb25f374 100644 --- a/zuul/_setup_hook.py +++ b/zuul/_setup_hook.py @@ -29,6 +29,10 @@ def _build_javascript(): if r: raise RuntimeError("Yarn install failed") if not os.path.exists('zuul/web/static/index.html'): + os.makedirs('zuul/web/static', exist_ok=True) + if not os.path.islink('../zuul/web/static'): + os.symlink('../zuul/web/static', 'web/build', + target_is_directory=True) r = subprocess.Popen(['yarn', 'build'], cwd="web/").wait() if r: raise RuntimeError("Yarn build failed") diff --git a/zuul/web/static/.keep b/zuul/web/static/.keep deleted file mode 100644 index e69de29bb2..0000000000