-
Notifications
You must be signed in to change notification settings - Fork 226
client: replace submodule with specific release #1998
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
Changes from 50 commits
9e1fd06
3562b29
cba366d
c826032
08dcc74
a6ad783
37618a4
c6e75bb
0c13e4c
258400c
d1348c8
dca226d
cf7b059
dadcae5
7d16353
6e59607
72ae170
decdb16
7992f09
864ed5b
be4c142
5f75cc9
4b941b1
dfefee8
0f59ccf
6d769e5
58b16f5
cf12b50
cffa55c
dfa1e6d
ee5d01f
25e435b
e3384de
60ae5b6
068a376
b0e49d5
700e7d5
24d059b
d8e7e2d
29413f1
d35b4b4
28ebe76
422ddd1
8e1f55f
ce711c7
bff8195
2e1d520
39c8619
e5f760a
279870a
fdd8d40
6af66c1
75b6c77
9df49d1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,7 @@ | |
| *.swp | ||
| *.swo | ||
| /.env | ||
| /client/ | ||
| /docker-compose.override.yml | ||
| /version.txt | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,3 @@ | ||
| [submodule "server"] | ||
| path = server | ||
| url = https://github.com/getodk/central-backend.git | ||
| [submodule "client"] | ||
| path = client | ||
| url = https://github.com/getodk/central-frontend.git |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,10 +2,10 @@ | |
| set -o pipefail | ||
| shopt -s inherit_errexit | ||
|
|
||
| cd client | ||
| log() { echo >&2 "[build-frontend] $*"; } | ||
|
|
||
| if [[ ${SKIP_FRONTEND_BUILD-} != "" ]]; then | ||
| echo "[build-frontend] Skipping frontend build." | ||
| if [[ $FRONTEND_BUILD_MODE = test ]]; then | ||
| log "Building mock frontend..." | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Feel free to leave this for a subsequent issue...
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Definitely worth considering 👍 |
||
|
|
||
| # Create minimal fake frontend to allow tests to pass: | ||
| mkdir dist dist/assets dist/fonts dist/apps dist/apps/forms | ||
|
|
@@ -39,9 +39,55 @@ if [[ ${SKIP_FRONTEND_BUILD-} != "" ]]; then | |
| } | ||
|
|
||
| generateFile 10k-file.txt 10240 | ||
| elif [[ $FRONTEND_BUILD_MODE = source ]]; then | ||
| log "Building frontend from source..." | ||
|
|
||
| if ! [[ -d client ]]; then | ||
| log "!!!" | ||
| log "!!! No frontend repository found at ./client" | ||
| log "!!!" | ||
| log "!!! Make sure this directory is present, or change FRONTEND_BUILD_MODE." | ||
| log "!!!" | ||
| exit 1 | ||
| fi | ||
| if ! [[ -f client/package.json ]]; then | ||
| log "!!!" | ||
| log "!!! No NodeJS project found in ./client" | ||
| log "!!!" | ||
| log "!!! Make sure this file is present, or change FRONTEND_BUILD_MODE." | ||
| log "!!!" | ||
| exit 1 | ||
| fi | ||
|
|
||
| cd client | ||
|
|
||
| exit | ||
| else | ||
| npm clean-install --no-audit --fund=false --update-notifier=false | ||
| NODE_OPTIONS="--max-old-space-size=2048" npm run build | ||
|
|
||
| mv dist .. | ||
| elif [[ $FRONTEND_BUILD_MODE = fetch ]]; then | ||
| log "Fetching pre-built frontend..." | ||
|
|
||
| filename="dist-$FRONTEND_VERSION.tar.gz" | ||
|
|
||
| artifactUrl="https://github.com/getodk/central-frontend/releases/download/$FRONTEND_VERSION/$filename" | ||
| log "Fetching release artifact from $artifactUrl ..." | ||
| curl \ | ||
| --connect-timeout 60 \ | ||
| --fail \ | ||
| --retry 5 \ | ||
| --retry-delay 10 \ | ||
| --retry-all-errors \ | ||
| --location "$artifactUrl" \ | ||
| --output "$filename" | ||
|
|
||
| log "Extracting dist bundle..." | ||
| tar --extract --file "$filename" | ||
| else | ||
| log "!!!" | ||
| log "!!! Unrecognised FRONTEND_BUILD_MODE: '$FRONTEND_BUILD_MODE'" | ||
| log "!!!" | ||
| exit 1 | ||
| fi | ||
|
|
||
| log "Completed OK." | ||
Uh oh!
There was an error while loading. Please reload this page.