parent
e2f2e9ae4e
commit
e7521110c9
2 changed files with 25 additions and 1 deletions
|
|
@ -12,6 +12,8 @@
|
||||||
|
|
||||||
(def image-name "babashka/babashka")
|
(def image-name "babashka/babashka")
|
||||||
|
|
||||||
|
(def ghcr-image-name "ghcr.io/babashka/babashka")
|
||||||
|
|
||||||
(def image-tag (str/trim (slurp "resources/BABASHKA_VERSION")))
|
(def image-tag (str/trim (slurp "resources/BABASHKA_VERSION")))
|
||||||
|
|
||||||
(def latest-tag "latest")
|
(def latest-tag "latest")
|
||||||
|
|
@ -46,6 +48,11 @@
|
||||||
[username password]
|
[username password]
|
||||||
(exec ["docker" "login" "-u" username "-p" password]))
|
(exec ["docker" "login" "-u" username "-p" password]))
|
||||||
|
|
||||||
|
(defn docker-login-ghcr
|
||||||
|
[username password]
|
||||||
|
(exec ["docker" "login" "ghcr.io" "-u" username "-p" password]))
|
||||||
|
|
||||||
|
;; TODO: Remove this when Dockerhub goes off
|
||||||
(defn build-push
|
(defn build-push
|
||||||
[image-tag platform docker-file]
|
[image-tag platform docker-file]
|
||||||
(println (format "Building and pushing %s Docker image(s) %s:%s"
|
(println (format "Building and pushing %s Docker image(s) %s:%s"
|
||||||
|
|
@ -59,6 +66,19 @@
|
||||||
"-f" docker-file]]
|
"-f" docker-file]]
|
||||||
(exec (concat base-cmd label-args ["."]))))
|
(exec (concat base-cmd label-args ["."]))))
|
||||||
|
|
||||||
|
(defn build-push-ghcr
|
||||||
|
[image-tag platform docker-file]
|
||||||
|
(println (format "Building and pushing %s Docker image(s) %s:%s to GHCR"
|
||||||
|
platform
|
||||||
|
ghcr-image-name
|
||||||
|
image-tag))
|
||||||
|
(let [base-cmd ["docker" "buildx" "build"
|
||||||
|
"-t" (str ghcr-image-name ":" image-tag)
|
||||||
|
"--platform" platform
|
||||||
|
"--push"
|
||||||
|
"-f" docker-file]]
|
||||||
|
(exec (concat base-cmd label-args ["."]))))
|
||||||
|
|
||||||
(defn build-push-images
|
(defn build-push-images
|
||||||
[]
|
[]
|
||||||
(doseq [platform (str/split platforms #",")]
|
(doseq [platform (str/split platforms #",")]
|
||||||
|
|
@ -74,8 +94,10 @@
|
||||||
; this overwrites, but this is to work around having built the uberjar/metabom multiple times
|
; this overwrites, but this is to work around having built the uberjar/metabom multiple times
|
||||||
(fs/copy (format "/tmp/release/%s-metabom.jar" tarball-platform) "metabom.jar" {:replace-existing true})))
|
(fs/copy (format "/tmp/release/%s-metabom.jar" tarball-platform) "metabom.jar" {:replace-existing true})))
|
||||||
(build-push image-tag platforms "Dockerfile.ci")
|
(build-push image-tag platforms "Dockerfile.ci")
|
||||||
|
(build-push-ghcr image-tag platforms "Dockerfile.ci")
|
||||||
(when-not snapshot?
|
(when-not snapshot?
|
||||||
(build-push latest-tag platforms "Dockerfile.ci")))
|
(build-push latest-tag platforms "Dockerfile.ci")
|
||||||
|
(build-push-ghcr latest-tag platforms "Dockerfile.ci")))
|
||||||
|
|
||||||
(defn build-push-alpine-images
|
(defn build-push-alpine-images
|
||||||
"Build alpine image for linux-amd64 only (no upstream arm64 support yet)"
|
"Build alpine image for linux-amd64 only (no upstream arm64 support yet)"
|
||||||
|
|
@ -93,6 +115,7 @@
|
||||||
(println "This is a snapshot version")
|
(println "This is a snapshot version")
|
||||||
(println "This is a non-snapshot version"))
|
(println "This is a non-snapshot version"))
|
||||||
(docker-login (read-env "DOCKERHUB_USER") (read-env "DOCKERHUB_PASS"))
|
(docker-login (read-env "DOCKERHUB_USER") (read-env "DOCKERHUB_PASS"))
|
||||||
|
(docker-login-ghcr (read-env "CONTAINER_REGISTRY_USER") (read-env "BB_GHCR_TOKEN"))
|
||||||
(build-push-images)
|
(build-push-images)
|
||||||
(build-push-alpine-images))
|
(build-push-alpine-images))
|
||||||
(println "Not publishing docker image(s).")))
|
(println "Not publishing docker image(s).")))
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ A preview of the next release can be installed from
|
||||||
- [#1507](https://github.com/babashka/babashka/issues/1507): Expose methods on java.lang.VirtualThread ([@lispyclouds](https://github.com/lispyclouds))
|
- [#1507](https://github.com/babashka/babashka/issues/1507): Expose methods on java.lang.VirtualThread ([@lispyclouds](https://github.com/lispyclouds))
|
||||||
- [#1510](https://github.com/babashka/babashka/issues/1510): add virtual thread interop on `Thread`
|
- [#1510](https://github.com/babashka/babashka/issues/1510): add virtual thread interop on `Thread`
|
||||||
- [#1511](https://github.com/babashka/babashka/issues/1511): support domain sockets
|
- [#1511](https://github.com/babashka/babashka/issues/1511): support domain sockets
|
||||||
|
- [#1521](https://github.com/babashka/babashka/issues/1521): push images to GHCR ([@lispyclouds](https://github.com/lispyclouds))
|
||||||
|
|
||||||
## 1.2.174 (2023-03-01)
|
## 1.2.174 (2023-03-01)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue