Fork me on GitHub
#babashka
<
2020-07-03
>
Jakob Durstberger13:07:25

Is there a best way to make an HTTP POST request from a babashka script?

Jakob Durstberger13:07:50

Sorry I missed that part of the README. My bad 😕 Thank you

Daniel Tan14:07:59

is it possible to build a self executing bb script?

Daniel Tan14:07:12

where should i start?

jeroenvandijk14:07:48

@danieltanfh95 on OSX something like this:

echo '#!/usr/bin/env bb
(println "hello")' > 
chmod +x 
./hello.bb

Jakob Durstberger14:07:06

Sorry for the docker newb question. The docker image (https://hub.docker.com/r/borkdude/babashka/) linked from the readme runs the command “bb”. Is it possible to use the same image to execute a file instead? I’d like to use a docker image with babashka preinstalled to run a scrip on my CI

borkdude14:07:15

@jakob.durstberger yeah:

$ echo "(+ 1 2 3)" > foo.clj
$ docker run -v $PWD:/script borkdude/babashka bb -f script/foo.clj
6

Jakob Durstberger14:07:10

Ah so then I use the docker in docker image for that, right?

borkdude14:07:16

Docker in docker doesn't sound right to me

borkdude14:07:12

I was just showing how you can run the babashka docker image on your local machine. CI might be different

Jakob Durstberger14:07:35

We are using GitLab CI so each job in there is started from a docker image. So I have to use an image that has docker installed to then run the docker run ... command. Yeah I think I’ll figure it out from here Thanks for the help

Jakob Durstberger14:07:46

So far babashka is really awesome to use, thank you for creating it

borkdude14:07:28

@jakob.durstberger That sounds like a bad idea, don't use Docker in docker.

borkdude14:07:05

you can do FROM borkdude/babashka and then copy your files into the image

Jakob Durstberger14:07:18

I guess I can also create a docker image based on yours that just runs the shell at the end.

borkdude14:07:20

or just install babashka from Github releases into your image

👍 1
Jakob Durstberger14:07:35

The last option is probably the easiest in the end

borkdude14:07:03

if you're using alpine, then you'll need the static binary

Jakob Durstberger14:07:27

Thanks, I’ll try that