From b6f3167b9c4d219daddf6a86ab4df9a8eed4bec8 Mon Sep 17 00:00:00 2001 From: Tobias Henkel Date: Tue, 4 Jun 2019 19:44:09 +0200 Subject: [PATCH] Revert "Revert "Create zuul/web/static on demand"" The js content tarball creation was broken. Instead of leaving the symlink to a non-existing directory which gets created during python setup we should just remove that symlink as well and create the symlink and the static dir during the python setup. This way nothing will be in the way of the javascript content generation. This reverts commit eb7b18b38e01688b5b05e5dfdb359ff5d42d1ed8. Change-Id: I5f8bfa62cd2d4d9823b86dbcda14885230847a82 --- .gitignore | 1 + Dockerfile | 7 ++++++- tools/pip.sh | 2 ++ web/build | 1 - zuul/_setup_hook.py | 4 ++++ zuul/web/static/.keep | 0 6 files changed, 13 insertions(+), 2 deletions(-) delete mode 120000 web/build delete mode 100644 zuul/web/static/.keep 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 e1a30d5b30..c67e93d527 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,7 +26,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