cljdoc

tengstrand 2023-09-09T09:08:45.122869Z

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?

tengstrand 2023-09-09T13:27:19.711169Z

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.

lread 2023-09-09T13:29:01.620819Z

I use bb which includes everything I need

lread 2023-09-09T13:33:36.719049Z

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.

tengstrand 2023-09-09T13:40:35.521629Z

Okay, cool.

lread 2023-09-09T13:55:24.684419Z

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))

lread 2023-09-09T13:55:54.984029Z

(tried it, it works)

tengstrand 2023-09-09T15:10:25.214139Z

Thanks!!

tengstrand 2023-09-09T15:11:42.825329Z

That snippet could be nice to add to the documentation.

💡 1