|
23 | 23 | "oss" :ce |
24 | 24 | "ee" :ee))) |
25 | 25 |
|
26 | | -(defn- build-frontend! [] |
27 | | - (u/step "Build frontend" |
28 | | - (u/step "Run 'yarn' to download javascript dependencies" |
29 | | - (u/sh {:dir u/project-root-directory} "yarn")) |
30 | | - (u/step "Run 'webpack' with NODE_ENV=production to assemble and minify frontend assets" |
31 | | - (u/sh {:dir u/project-root-directory |
32 | | - :env {"PATH" (env/env :path) |
33 | | - "HOME" (env/env :user-home) |
34 | | - "NODE_ENV" "production" |
35 | | - "MB_EDITION" (name (edition-from-env-var))}} |
36 | | - "./node_modules/.bin/webpack" "--bail")) |
37 | | - (u/announce "Frontend built successfully."))) |
| 26 | +(defn- build-frontend! [edition] |
| 27 | + {:pre [(#{:ce :ee} edition)]} |
| 28 | + (let [mb-edition (case edition |
| 29 | + :ee "ee" |
| 30 | + :ce "oss")] |
| 31 | + (u/step (format "Build frontend with MB_EDITION=%s" mb-edition) |
| 32 | + (u/step "Run 'yarn' to download javascript dependencies" |
| 33 | + (u/sh {:dir u/project-root-directory} "yarn")) |
| 34 | + (u/step "Run 'webpack' with NODE_ENV=production to assemble and minify frontend assets" |
| 35 | + (u/sh {:dir u/project-root-directory |
| 36 | + :env {"PATH" (env/env :path) |
| 37 | + "HOME" (env/env :user-home) |
| 38 | + "NODE_ENV" "production" |
| 39 | + "MB_EDITION" mb-edition}} |
| 40 | + "./node_modules/.bin/webpack" "--bail")) |
| 41 | + (u/announce "Frontend built successfully.")))) |
38 | 42 |
|
39 | 43 | (def uberjar-filename (u/filename u/project-root-directory "target" "uberjar" "metabase.jar")) |
40 | 44 |
|
|
45 | 49 | :ee "ee" |
46 | 50 | :ce "oss")] |
47 | 51 | (u/delete-file-if-exists! uberjar-filename) |
48 | | - (u/step "Build uberjar" |
| 52 | + (u/step (format "Build uberjar with profile %s" profile) |
49 | 53 | (u/sh {:dir u/project-root-directory} "lein" "clean") |
50 | 54 | (u/sh {:dir u/project-root-directory} "lein" "with-profile" (str \+ profile) "uberjar") |
51 | 55 | (u/assert-file-exists uberjar-filename) |
|
57 | 61 | (version-info/generate-version-info-file! version)) |
58 | 62 | :translations (fn [_] |
59 | 63 | (build-translation-resources!)) |
60 | | - :frontend (fn [_] |
61 | | - (build-frontend!)) |
| 64 | + :frontend (fn [{:keys [edition]}] |
| 65 | + (build-frontend! edition)) |
62 | 66 | :drivers (fn [_] |
63 | 67 | (build-drivers/build-drivers!)) |
64 | 68 | :uberjar (fn [{:keys [edition]}] |
|
0 commit comments