Browse Source

Create zuul/web/static on demand

We generate the static web build into zuul/web/static which gets
cleaned by yarn before the build. This directory must be existing
before running the yarn build. In order to guarantee that it exists we
currently have the file zuul/web/static/.keep under version
control. This problem with this is that every time the yarn build is
done (e.g. re-creating the tox environment) this file is deleted. This
file deletion is often added to commits accidentally. We can avoid
needing this file if we create the target dir on demand.

Change-Id: I6e94316a89373af1cbfc0abcfc403b54e33046a3
changes/98/661498/1
Tobias Henkel 2 years ago
parent
commit
64e2bc8ba8
No known key found for this signature in database GPG Key ID: 3750DEC158E5FA2
3 changed files with 2 additions and 0 deletions
  1. +1
    -0
      tools/pip.sh
  2. +1
    -0
      zuul/_setup_hook.py
  3. +0
    -0
      zuul/web/static/.keep

+ 1
- 0
tools/pip.sh View File

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


+ 1
- 0
zuul/_setup_hook.py View File

@ -29,6 +29,7 @@ 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)
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