Skip to content
Snippets Groups Projects
Unverified Commit f2188257 authored by metabase-bot[bot]'s avatar metabase-bot[bot] Committed by GitHub
Browse files

Release script fix (#28803) (#28808)

* Release script fix

* Add test :wrench:



Co-authored-by: default avatarCam Saul <1455846+camsaul@users.noreply.github.com>
parent ed60a018
Branches
Tags
No related merge requests found
......@@ -92,4 +92,4 @@
("bin"
(clojure-mode
(cider-clojure-cli-aliases . "dev"))))
(cider-clojure-cli-aliases . "dev:drivers:build:build-dev"))))
......@@ -12,11 +12,11 @@
(def ^String uberjar-path
(u/filename root-directory "target" "uberjar" "metabase.jar"))
(defonce ^:private build-options
(defonce ^:private ^:dynamic *build-options*
(atom nil))
(defn- build-option-or-throw [k]
(or (get @build-options k)
(or (get @*build-options* k)
(let [msg (format "%s is not set. Run release.set-build-options/prompt-and-set-build-options! to set it."
(name k))
e (ex-info msg {})]
......@@ -36,7 +36,7 @@
(defn set-version! [new-version]
;; strip off initial `v` if present
(swap! build-options assoc :version (str/replace new-version #"^v" "")))
(swap! *build-options* assoc :version (str/replace new-version #"^v" "")))
(defn github-milestone
"Name of GitHub milestone to query for fixed issue descriptions. Same as version, except for enterprise edition, in
......@@ -45,7 +45,7 @@
(build-option-or-throw :github-milestone))
(defn set-github-milestone! [new-github-milestone]
(swap! build-options assoc :github-milestone new-github-milestone))
(swap! *build-options* assoc :github-milestone new-github-milestone))
(defn branch
"Branch we are building from, e.g. `release-0.36.x`"
......@@ -53,7 +53,7 @@
(build-option-or-throw :branch))
(defn set-branch! [new-branch]
(swap! build-options assoc :branch new-branch))
(swap! *build-options* assoc :branch new-branch))
(defn edition
"Either `:oss` (Community Edition) or `:ee` (Enterprise Edition)."
......@@ -63,7 +63,7 @@
(defn set-edition! [new-edition]
(assert (#{:oss :ee} new-edition))
(swap! build-options assoc :edition new-edition))
(swap! *build-options* assoc :edition new-edition))
(defn pre-release-version?
"Whether this version should be considered a prerelease. True if the version doesn't follow the usual
......
......@@ -94,9 +94,9 @@
(u/step (format "Create launch-aws-eb.html for Docker image %s" (c/docker-tag))
(u/delete-file-if-exists! html-file-path)
(spit html-file-path
(stencil/render-file launch-template-filename
{:url (java.net.URLEncoder/encode (c/artifact-download-url "metabase-aws-eb.zip")
"UTF-8")}))
(stencil/render (slurp launch-template-filename)
{:url (java.net.URLEncoder/encode (c/artifact-download-url "metabase-aws-eb.zip")
"UTF-8")}))
(u/assert-file-exists html-file-path)))
(defn- upload-artifacts! []
......
(ns release.elastic-beanstalk-test
(:require
[clojure.test :refer :all]
[release.common :as c]
[release.elastic-beanstalk :as release.eb]))
(deftest create-html-file-test
(testing "Just make sure this doesn't barf."
(binding [c/*build-options* (atom {:version "0.46.0-test"
:edition :oss})]
(is (string? (#'release.eb/create-html-file!))))))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment