Fork me on GitHub
#babashka
<
2021-04-25
>
Karol Wójcik08:04:36

@borkdude how can I point to remote scripts? This is what I have now:

{:paths [""]

 :holy-lambda/options {:build-tool    :lein ;; or :deps
                       :runtime       {:name :babashka} ;; Possible runtime :babashka, :native, :java
                       }

 :infrastructure {:bucket-prefix  "prefix"
                  :bucket-name    "bucket"
                  :region         "region"}

 :tasks {:requires                ([holy-lambda.tasks])

         docker:build:ee          holy-lambda.tasks/docker-build-ee
         sync:update              holy-lambda.tasks/sync:update
         version                  holy-lambda.tasks/version
         doctor                   holy-lambda.tasks/doctor
         purge                    holy-lambda.tasks/purge}}
When running the task the script is not found.

borkdude08:04:00

@karol.wojcik Where did you get the idea that "remote scripts" were supported :-D?

borkdude08:04:20

You can make a git library from it and point to it in :deps same as with deps.edn

borkdude08:04:13

Oh, I misinterpreted that. I thought you meant: is it ok if I share the link to a library on github in this channel :)

Karol Wójcik08:04:36

Will try the deps.edn approach then 😄

borkdude08:04:05

@karol.wojcik What was the other bug you found?

Karol Wójcik08:04:55

{:paths ["script"
         ;; ""
         ]

 :holy-lambda/options {:build-tool    :lein ;; or :deps
                       :runtime       {:name :babashka} ;; Possible runtime :babashka, :native, :java
                       }

 :infrastructure {:bucket-prefix  "prefix"
                  :bucket-name    "bucket"
                  :region         "region"}

 :tasks {:requires                ([holy-lambda.tasks :as tasks])

         docker:build:ee          tasks/docker-build-ee <-- needs fully qualified symbol otherwise it does not work.
         sync:update              tasks/sync:update
         version                  tasks/version
         doctor                   tasks/doctor
         purge                    tasks/purge
         }}

Karol Wójcik08:04:40

Using :as does not work in :requires when script is from :paths

borkdude08:04:33

oh cool, I'll fix that

borkdude09:04:54

Fixed on master

borkdude09:04:41

@karol.wojcik Was this bug only related to bb tasks docstrings or also to execution of these tasks?

borkdude09:04:20

I guess also to execution, will also fix that

borkdude09:04:17

Fixed on master

borkdude09:04:40

I am contemplating letting tasks not print the return value by default (like scripts always have done so far which might have been a mistake, but accidentally happened) But still it is convenient to view the result of a (helper) task to debug.

borkdude09:04:07

So maybe bb run --prn foo could be used to explicitly print and bb foo doesn't print

borkdude10:04:41

Or maybe it should be a property of a task if it will print or not?

borkdude10:04:15

{:tasks {foo {:print true :task (System/getenv "FOOBAR")}}}

borkdude12:04:04

@mike1452 shell now supports :continue true to ignore the exit code (so it won't exit bb in that case)

borkdude12:04:01

Also tasks do not print their return value anymore (unless explicitly done or using the run --prn command line opts)

borkdude12:04:05

It's also possible to use the return value of shell and clojure now

borkdude12:04:37

And there is some logging around task names and shell/clojure arguments when setting :log-level :info in the task(s)

borkdude12:04:01

There is also a :min-bb-version to print a warning in case people use an older one (top level in bb.edn)

borkdude13:04:10

Please do try out your bb with {:tasks {:log-level :info ...}} to see if it's useful

mike_ananev13:04:37

@borkdude cool! I'll check new version and change my templates. You are doing awesome work!