Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
e815a194
Commit
e815a194
authored
6 years ago
by
Tom Robinson
Browse files
Options
Downloads
Patches
Plain Diff
Integrate translation builds into ./bin/build
parent
a0d092c7
Loading
Loading
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Dockerfile
+3
-2
3 additions, 2 deletions
Dockerfile
bin/build
+15
-1
15 additions, 1 deletion
bin/build
docs/developers-guide.md
+3
-4
3 additions, 4 deletions
docs/developers-guide.md
with
21 additions
and
7 deletions
Dockerfile
+
3
−
2
View file @
e815a194
...
...
@@ -2,7 +2,7 @@
# STAGE 1: builder
###################
FROM
java:openjdk-8-j
re
-alpine
as
builder
FROM
java:openjdk-8-j
dk
-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
...
...
This diff is collapsed.
Click to expand it.
bin/build
+
15
−
1
View file @
e815a194
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
docs/developers-guide.md
+
3
−
4
View file @
e815a194
...
...
@@ -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/):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment