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 eb7b18b38e.

Change-Id: I5f8bfa62cd2d4d9823b86dbcda14885230847a82
This commit is contained in:
Tobias Henkel 2019-06-04 19:44:09 +02:00
parent c04a8b1983
commit b6f3167b9c
No known key found for this signature in database
GPG Key ID: 03750DEC158E5FA2
6 changed files with 13 additions and 2 deletions

1
.gitignore vendored
View File

@ -19,6 +19,7 @@ zuul/versioninfo
dist/ dist/
cover/ cover/
htmlcov/ htmlcov/
web/build
zuul/web/static/* zuul/web/static/*
!.keep !.keep
node_modules node_modules

View File

@ -26,7 +26,12 @@ ARG OPENSHIFT_SHA=4b0f07428ba854174c58d2e38287e5402964c9a9355f6c359d1242efd0990d
COPY . /tmp/src COPY . /tmp/src
RUN /tmp/src/tools/install-js-tools.sh RUN /tmp/src/tools/install-js-tools.sh
# Explicitly run the Javascript build # 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 RUN assemble
# The wheel install method doesn't run the setup hooks as the source based # The wheel install method doesn't run the setup hooks as the source based

View File

@ -39,6 +39,8 @@ then
fi fi
if [[ ! -f zuul/web/static/status.html ]] if [[ ! -f zuul/web/static/status.html ]]
then then
mkdir -p zuul/web/static
ln -sfn ../zuul/web/static web/build
pushd web/ pushd web/
yarn install yarn install
yarn build yarn build

View File

@ -1 +0,0 @@
../zuul/web/static/

View File

@ -29,6 +29,10 @@ def _build_javascript():
if r: if r:
raise RuntimeError("Yarn install failed") raise RuntimeError("Yarn install failed")
if not os.path.exists('zuul/web/static/index.html'): 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() r = subprocess.Popen(['yarn', 'build'], cwd="web/").wait()
if r: if r:
raise RuntimeError("Yarn build failed") raise RuntimeError("Yarn build failed")

View File