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
This commit is contained in:
Tobias Henkel committed 2019-05-26 20:58:46 +02:00
1 parent af910d9d8e
commit 64e2bc8ba8
3 files changed
+2

No files matched your search

+1
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
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")
View File
Whitespace-only changes.