From a6e23bcca998c94d72a443d0916e0601ab5397cf Mon Sep 17 00:00:00 2001 From: Paul Rosenzweig <paulrosenzweig@users.noreply.github.com> Date: Fri, 13 Nov 2020 15:33:33 -0500 Subject: [PATCH] Pass MB_EDITION to webpack build (#13780) * pass mb-edition to webpack build * oops. pass "ee" rather than ":ee" --- bin/build-mb/build.clj | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/bin/build-mb/build.clj b/bin/build-mb/build.clj index 432d6a1b3f6..ff932c931ea 100644 --- a/bin/build-mb/build.clj +++ b/bin/build-mb/build.clj @@ -15,15 +15,24 @@ (u/sh {:dir u/project-root-directory} "./bin/i18n/build-translation-resources") (u/announce "Translation resources built successfully."))) +(defn- edition-from-env-var [] + ;; MB_EDITION is either oss/ee, but the Clojure build scripts currently use :ce/:ee + (if-not (env/env :mb-edition) + :ce + (case (env/env :mb-edition) + "oss" :ce + "ee" :ee))) + (defn- build-frontend! [] (u/step "Build frontend" (u/step "Run 'yarn' to download javascript dependencies" (u/sh {:dir u/project-root-directory} "yarn")) (u/step "Run 'webpack' with NODE_ENV=production to assemble and minify frontend assets" (u/sh {:dir u/project-root-directory - :env {"PATH" (env/env :path) - "HOME" (env/env :user-home) - "NODE_ENV" "production"}} + :env {"PATH" (env/env :path) + "HOME" (env/env :user-home) + "NODE_ENV" "production" + "MB_EDITION" (name (edition-from-env-var))}} "./node_modules/.bin/webpack" "--bail")) (u/announce "Frontend built successfully."))) @@ -77,14 +86,6 @@ (step-fn {:version version, :edition edition})) (u/announce "All build steps finished.")))) -(defn- edition-from-env-var [] - ;; MB_EDITION is either oss/ee, but the Clojure build scripts currently use :ce/:ee - (if-not (env/env :mb-edition) - :ce - (case (env/env :mb-edition) - "oss" :ce - "ee" :ee))) - (defn -main [& steps] (u/exit-when-finished-nonzero-on-exception (build! (merge {:edition (edition-from-env-var)} -- GitLab