Skip to content

Commit a6e23bc

Browse files
Pass MB_EDITION to webpack build (metabase#13780)
* pass mb-edition to webpack build * oops. pass "ee" rather than ":ee"
1 parent d8e09bf commit a6e23bc

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

bin/build-mb/build.clj

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,24 @@
1515
(u/sh {:dir u/project-root-directory} "./bin/i18n/build-translation-resources")
1616
(u/announce "Translation resources built successfully.")))
1717

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+
1826
(defn- build-frontend! []
1927
(u/step "Build frontend"
2028
(u/step "Run 'yarn' to download javascript dependencies"
2129
(u/sh {:dir u/project-root-directory} "yarn"))
2230
(u/step "Run 'webpack' with NODE_ENV=production to assemble and minify frontend assets"
2331
(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))}}
2736
"./node_modules/.bin/webpack" "--bail"))
2837
(u/announce "Frontend built successfully.")))
2938

@@ -77,14 +86,6 @@
7786
(step-fn {:version version, :edition edition}))
7887
(u/announce "All build steps finished."))))
7988

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-
8889
(defn -main [& steps]
8990
(u/exit-when-finished-nonzero-on-exception
9091
(build! (merge {:edition (edition-from-env-var)}

0 commit comments

Comments
 (0)