-
Notifications
You must be signed in to change notification settings - Fork 0
/
bb.edn
31 lines (28 loc) · 1.63 KB
/
bb.edn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{:min-bb-version "0.4.0"
:tasks {:requires ([babashka.fs :as fs])
:init (do
(def binary "terraform-provider-bob")
(def version "0.1.0")
(defn os-arch
[]
(let [lookup {"Mac OS X" "darwin"
"Linux" "linux"}
os (System/getProperty "os.name")
arch (System/getProperty "os.arch")]
(format "%s_%s"
(lookup os)
arch)))
(def install-dir
(format "%s/.terraform.d/plugins/bob-cd/providers/bob/%s/%s"
(fs/home)
version
(os-arch))))
build {:doc "Compile the binary"
:task (shell (str "go build -o " binary))}
install {:doc "Install the binary into plugins dir"
:depends [build]
:task (do
(fs/create-dirs install-dir)
(fs/move binary install-dir {:replace-existing true})
(fs/delete-tree "examples/.terraform")
(fs/delete-if-exists "examples/.terraform.lock.hcl"))}}}