Fork me on GitHub
#cljdoc
<
2023-09-09
>
tengstrand09:09:45

I need to be able to trigger a build/rebuild of a SNAPSHOT release, in my CI script (by calling a function in build.clj). It's documented https://github.com/cljdoc/cljdoc/blob/master/doc/docsets.md#trigger-a-build-for-a-project but is there some Clojure code somewhere that already does this that I can steal?

tengstrand13:09:19

Thanks, will check later when I’m back home. I guess curl is always installed, so this will therefore work, otherwise we need to use some libraries.

lread13:09:01

I use bb which includes everything I need

lread13:09:36

Oh wait, I see your point, my example spawned to curl... right. Don't have to do that anymore, can use https://github.com/babashka/http-client.

lread13:09:24

So, taking an arbitrary project I found that has a SNAPSHOT build... something like this:

(require '[babashka.http-client :as http])

(let [{:keys [status]} (http/post ""
                                  {:throw false
                                   :form-params {"project" "clj-pail/clj-pail"
                                                 "version" "0.1.6-SNAPSHOT"}})]

  (println "Status of build request" status))

lread13:09:54

(tried it, it works)

tengstrand15:09:42

That snippet could be nice to add to the documentation.

💡 2