Releases (#1)

Rename babashka to atomisthq
This commit is contained in:
Jim Clark
2022-12-06 22:19:23 -08:00
committed by GitHub
parent 17327a8739
commit 29e586ff95
5 changed files with 27 additions and 6 deletions

4
.gitignore vendored
View File

@@ -2,3 +2,7 @@
/.clj-kondo/
/.cpcache/
/.lsp/
/pod-babashka-docker
/pod-babashka-docker-0.1.0-macos-aarch64.zip
/pod-atomisthq-docker
/pod-atomisthq-docker-0.1.0-macos-aarch64.zip

View File

@@ -14,7 +14,7 @@ This is a [babashka pod](https://github.com/babashka/pods) that binds some golan
#_(pods/load-pod "./parser")
;; load-pod will create this namespace with two vars
(require '[pod.babashka.docker :as docker])
(require '[pod.atomisthq.docker :as docker])
;; parse image names using github.com/docker/distribution
;; turns golang structs into clojure maps
@@ -31,12 +31,14 @@ This is a [babashka pod](https://github.com/babashka/pods) that binds some golan
(docker/parse-dockerfile "FROM \\\n gcr.io/whatever:tag\nCMD [\"run\"]")
```
Loading `'atomisthq/docker` from the pod registry will download the binary into `${user.home}/.babashka/pods/registry` (the `$BABASHKA_PODS_DIR` environment variable will be used if it exists).
## Building
To build the golang `parser` binary locally, run `go build`.
```bash
go build
go build -o pod-babashka-docker
```
## Contributing

15
bb.edn Normal file
View File

@@ -0,0 +1,15 @@
{:tasks
{:requires ([babashka.fs :as fs])
:init (do
(def n "pod-atomisthq-docker")
(def os "macos")
(def version "0.1.0"))
build (shell (format "go build -o %s" n))
aarch64 (do
(shell (format "zip %s-%s-%s-%s.zip %s" n version os "aarch64" n) {}))
x86 (do
(shell (format "zip %s-%s-%s-%s.zip %s" n version os "x86_64" n) {}))
linux-x86
(do
(shell (format "zip %s-%s-%s-%s.zip %s" n version "linux" "amd64" n) {}))}}

View File

@@ -2,7 +2,7 @@
(:require [babashka.pods :as pods]))
(pods/load-pod 'atomisthq/docker "0.1.0")
(require '[pod.babashka.docker :as docker])
(require '[pod.atomisthq.docker :as docker])
;; parse image names using github.com/docker/distribution
;; turns golang structs into clojure maps

View File

@@ -60,7 +60,7 @@ func ProcessMessage(message *babashka.Message) (any, error) {
Format: "json",
Namespaces: []babashka.Namespace{
{
Name: "pod.babashka.docker",
Name: "pod.atomisthq.docker",
Vars: []babashka.Var{
{
Name: "parse-image-name",
@@ -74,14 +74,14 @@ func ProcessMessage(message *babashka.Message) (any, error) {
}, nil
case "invoke":
switch message.Var {
case "pod.babashka.docker/parse-image-name":
case "pod.atomisthq.docker/parse-image-name":
args := []string{}
if err := json.Unmarshal([]byte(message.Args), &args); err != nil {
return nil, err
}
return parse_uri(args[0])
case "pod.babashka.docker/parse-dockerfile":
case "pod.atomisthq.docker/parse-dockerfile":
args := []string{}
if err := json.Unmarshal([]byte(message.Args), &args); err != nil {
return nil, err