Optimise executors when shorted (#1301)
* Optimise executors when shorted * Test short * Also handle mac * Test short
This commit is contained in:
parent
b5dea3563d
commit
512dbf9ea5
1 changed files with 102 additions and 88 deletions
|
|
@ -21,12 +21,21 @@
|
|||
[(run "Shorted" "echo 'Skipping Run'")]
|
||||
steps))
|
||||
|
||||
(defn gen-job
|
||||
[shorted? conf]
|
||||
(if shorted?
|
||||
(-> conf
|
||||
(dissoc :machine :macos)
|
||||
(assoc :resource_class "small" :docker [{:image "ubuntu:latest"}]))
|
||||
conf))
|
||||
|
||||
(defn pull-submodules
|
||||
[]
|
||||
(run "Pull Submodules" "git submodule init\ngit submodule update"))
|
||||
|
||||
(defn deploy
|
||||
[shorted?]
|
||||
(gen-job shorted?
|
||||
(ordered-map
|
||||
:resource_class "large"
|
||||
:docker [{:image "circleci/clojure:lein-2.9.8"}]
|
||||
|
|
@ -40,10 +49,12 @@
|
|||
"v1-dependencies-"]}}
|
||||
{:run ".circleci/script/deploy"}
|
||||
{:save_cache {:paths ["~/.m2"]
|
||||
:key "v1-dependencies-{{ checksum \"project.clj\" }}"}}])))
|
||||
:key "v1-dependencies-{{ checksum \"project.clj\" }}"}}]))))
|
||||
|
||||
(defn docker
|
||||
[shorted?]
|
||||
(gen-job
|
||||
shorted?
|
||||
(ordered-map
|
||||
:machine {:image "ubuntu-2004:202111-01"}
|
||||
:steps
|
||||
|
|
@ -58,10 +69,12 @@
|
|||
{:name "Build Docker image"
|
||||
:environment {:PLATFORMS "linux/amd64,linux/arm64"}
|
||||
:command
|
||||
"java -jar ./target/babashka-$(cat resources/BABASHKA_VERSION)-standalone.jar .circleci/script/docker.clj"}}])))
|
||||
"java -jar ./target/babashka-$(cat resources/BABASHKA_VERSION)-standalone.jar .circleci/script/docker.clj"}}]))))
|
||||
|
||||
(defn jvm
|
||||
[shorted?]
|
||||
(gen-job
|
||||
shorted?
|
||||
(ordered-map
|
||||
:docker [{:image "circleci/clojure:openjdk-11-lein-2.9.8-bullseye"}]
|
||||
:working_directory "~/repo"
|
||||
|
|
@ -96,7 +109,7 @@ java -jar \"$jar\" --config .build/bb.edn --deps-root . release-artifact \"$refl
|
|||
{:store_artifacts {:path "/tmp/release"
|
||||
:destination "release"}}
|
||||
{:save_cache {:paths ["~/.m2"]
|
||||
:key "v1-dependencies-{{ checksum \"project.clj\" }}-{{ checksum \"deps.edn\" }}"}}])))
|
||||
:key "v1-dependencies-{{ checksum \"project.clj\" }}-{{ checksum \"deps.edn\" }}"}}]))))
|
||||
|
||||
(defn unix
|
||||
[shorted? static? musl? arch executor-conf resource-class graalvm-home platform]
|
||||
|
|
@ -126,6 +139,7 @@ java -jar \"$jar\" --config .build/bb.edn --deps-root . release-artifact \"$refl
|
|||
(if (= "aarch64" arch)
|
||||
"aarch64-"
|
||||
""))]
|
||||
(gen-job shorted?
|
||||
(merge
|
||||
executor-conf
|
||||
(ordered-map
|
||||
|
|
@ -159,7 +173,7 @@ java -jar \"$jar\" --config .build/bb.edn --deps-root . release-artifact \"$refl
|
|||
{:store_artifacts {:path "/tmp/release"
|
||||
:destination "release"}}
|
||||
(run "Publish artifact link to Slack"
|
||||
"./bb .circleci/script/publish_artifact.clj || true")]))))))
|
||||
"./bb .circleci/script/publish_artifact.clj || true")])))))))
|
||||
|
||||
(defn make-config
|
||||
[shorted?]
|
||||
|
|
|
|||
Loading…
Reference in a new issue