|
15 | 15 | (u/sh {:dir u/project-root-directory} "./bin/i18n/build-translation-resources") |
16 | 16 | (u/announce "Translation resources built successfully."))) |
17 | 17 |
|
| 18 | +(defn- edition-from-env-var [] |
| 19 | + ;; MB_EDITION is either oss/ee, but the Clojure build scripts currently use :ce/:ee |
| 20 | + (if-not (env/env :mb-edition) |
| 21 | + :ce |
| 22 | + (case (env/env :mb-edition) |
| 23 | + "oss" :ce |
| 24 | + "ee" :ee))) |
| 25 | + |
18 | 26 | (defn- build-frontend! [] |
19 | 27 | (u/step "Build frontend" |
20 | 28 | (u/step "Run 'yarn' to download javascript dependencies" |
21 | 29 | (u/sh {:dir u/project-root-directory} "yarn")) |
22 | 30 | (u/step "Run 'webpack' with NODE_ENV=production to assemble and minify frontend assets" |
23 | 31 | (u/sh {:dir u/project-root-directory |
24 | | - :env {"PATH" (env/env :path) |
25 | | - "HOME" (env/env :user-home) |
26 | | - "NODE_ENV" "production"}} |
| 32 | + :env {"PATH" (env/env :path) |
| 33 | + "HOME" (env/env :user-home) |
| 34 | + "NODE_ENV" "production" |
| 35 | + "MB_EDITION" (name (edition-from-env-var))}} |
27 | 36 | "./node_modules/.bin/webpack" "--bail")) |
28 | 37 | (u/announce "Frontend built successfully."))) |
29 | 38 |
|
|
77 | 86 | (step-fn {:version version, :edition edition})) |
78 | 87 | (u/announce "All build steps finished.")))) |
79 | 88 |
|
80 | | -(defn- edition-from-env-var [] |
81 | | - ;; MB_EDITION is either oss/ee, but the Clojure build scripts currently use :ce/:ee |
82 | | - (if-not (env/env :mb-edition) |
83 | | - :ce |
84 | | - (case (env/env :mb-edition) |
85 | | - "oss" :ce |
86 | | - "ee" :ee))) |
87 | | - |
88 | 89 | (defn -main [& steps] |
89 | 90 | (u/exit-when-finished-nonzero-on-exception |
90 | 91 | (build! (merge {:edition (edition-from-env-var)} |
|
0 commit comments