Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nginx: skip frontend build in tests #813

Merged
merged 1 commit into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions files/prebuild/build-frontend.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
#!/bin/bash -eu

cd client
npm clean-install --no-audit --fund=false --update-notifier=false
npm run build

if [[ ${SKIP_FRONTEND_BUILD-} != "" ]]; then
echo "[build-frontend] Skipping frontend build."

# Create minimal fake frontend to allow tests to pass:
mkdir -p dist
echo > dist/blank.html
echo > dist/favicon.ico
echo > dist/index.html '<div id="app"></div>'

exit
else
npm clean-install --no-audit --fund=false --update-notifier=false
npm run build
fi
2 changes: 2 additions & 0 deletions nginx.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ RUN apt-get update \

COPY ./ ./
RUN files/prebuild/write-version.sh

ARG SKIP_FRONTEND_BUILD
RUN files/prebuild/build-frontend.sh


Expand Down
2 changes: 2 additions & 0 deletions test/nginx.test.docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ services:
build:
context: ..
dockerfile: nginx.dockerfile
args:
SKIP_FRONTEND_BUILD: true
depends_on:
- service
- enketo
Expand Down
Loading