Browse Source

Merge "Revert "Revert "Create zuul/web/static on demand"""

changes/21/740121/1
Zuul 1 month ago
committed by Gerrit Code Review
parent
commit
141347e082
6 changed files with 13 additions and 2 deletions
  1. +1
    -0
      .gitignore
  2. +6
    -1
      Dockerfile
  3. +2
    -0
      tools/pip.sh
  4. +0
    -1
      web/build
  5. +4
    -0
      zuul/_setup_hook.py
  6. +0
    -0
      zuul/web/static/.keep

+ 1
- 0
.gitignore View File

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


+ 6
- 1
Dockerfile View File

@@ -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


+ 2
- 0
tools/pip.sh View File

@@ -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


+ 0
- 1
web/build View File

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

+ 4
- 0
zuul/_setup_hook.py View File

@@ -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")


+ 0
- 0
zuul/web/static/.keep View File


Loading…
Cancel
Save