Skip to content
Snippets Groups Projects
Commit e815a194 authored by Tom Robinson's avatar Tom Robinson
Browse files

Integrate translation builds into ./bin/build

parent a0d092c7
No related merge requests found
......@@ -2,7 +2,7 @@
# STAGE 1: builder
###################
FROM java:openjdk-8-jre-alpine as builder
FROM java:openjdk-8-jdk-alpine as builder
WORKDIR /app/source
......@@ -14,7 +14,8 @@ ENV LC_CTYPE en_US.UTF-8
# git: ./bin/version
# nodejs: frontend building
# make: backend building
RUN apk add --update bash nodejs git wget make
# gettext: translations
RUN apk add --update bash nodejs git wget make gettext
# yarn: frontend dependencies
RUN npm install -g yarn
......
......@@ -20,15 +20,25 @@ frontend-deps() {
}
frontend() {
frontend-deps
echo "Running 'webpack' with NODE_ENV=production assemble and minify frontend assets..." &&
NODE_ENV=production ./node_modules/.bin/webpack --bail
}
frontend-fast() {
frontend-deps
echo "Running 'webpack' with NODE_ENV=development to assemble frontend assets..." &&
NODE_ENV=development ./node_modules/.bin/webpack --bail --devtool eval
}
translations() {
echo "Running './bin/i18n/build-translation-resources' to build translation resources..."
if ! ./bin/i18n/build-translation-resources; then
echo "Building translation resources failed, please install 'gettext', or build without translations by running './bin/build no-translations'."
exit 1
fi
}
sample-dataset() {
if [ -f resources/sample-dataset.db.mv.db ]; then
echo "Sample Dataset already generated."
......@@ -44,7 +54,11 @@ uberjar() {
}
all() {
version && frontend-deps && frontend && sample-dataset && uberjar
version && translations && frontend && sample-dataset && uberjar
}
no-translations() {
version && frontend && sample-dataset && uberjar
}
# Default to running all but let someone specify one or more sub-tasks to run instead if desired
......
......@@ -111,7 +111,7 @@ $ yarn run build-watch
All frontend tests are located in `frontend/test` directory. Run all frontend tests with
```
./bin/build version uberjar && yarn run test
yarn run test
```
which will first build the backend JAR and then run integration, unit and Karma browser tests in sequence.
......@@ -123,10 +123,9 @@ Integration tests use an enforced file naming convention `<test-suite-name>.inte
Useful commands:
```bash
./bin/build version uberjar # Builds the JAR without frontend assets; run this every time you need to update the backend
lein run refresh-integration-test-db-metadata # Scan the sample dataset and re-run sync/classification/field values caching
yarn run test-integrated-watch # Watches for file changes and runs the tests that have changed
yarn run test-integrated-watch -- TestFileName # Watches the files in paths that match the given (regex) string
yarn run test-integrated-watch TestFileName # Watches the files in paths that match the given (regex) string
```
The way integration tests are written is a little unconventional so here is an example that hopefully helps in getting up to speed:
......@@ -266,7 +265,7 @@ Start up an instant cheatsheet for the project + dependencies by running
lein instant-cheatsheet
## Internationalization
We are an application with lots of users all over the world. To help them use Metabase in their own language, we mark all of our strings as i18n.
We are an application with lots of users all over the world. To help them use Metabase in their own language, we mark all of our strings as i18n.
### The general workflow for developers is:
1. Tag strings in the frontend using `t` and `jt` ES6 template literals (see more details in https://c-3po.js.org/):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment