monkey-projects / monkeyci

Next-generation CI/CD tool that uses the full power of Clojure!
https://monkeyci.com
GNU General Public License v3.0
5 stars 0 forks source link

Yaml support #150

Open wneirynck opened 6 months ago

wneirynck commented 6 months ago

The most powerful build script is of course the clojure script, but for beginning users or non-developers (or those that don't want to learn Clojure) we will provide the possibility to use yaml as a build script. This would only be useful for the most basic scenarios. For instance, there would be no way to provide conditions.

But we should be able to provide a way to "plug in" tags that can be handled by code. This would mean, if you include a library, or add both a yaml and a clj file, MonkeyCI would interpret them both and it should be possible to define functions in your Clojure code that can then be "invoked" using yaml. For instance:

job:
  name: test job
  custom-func:
     message: test message

And in clojure:

(register-custom-handler :custom-func
  (fn [{:keys [message]}]
    (println "this is the message:" message)))

This should make it possible for developers to provide their own custom handlers that can then be easily included in yaml build scripts. Or even in other clj scripts. See #105 for more on this.

wneirynck commented 6 months ago

The order in which script files are processed is this:

  1. Yaml
  2. Json
  3. Edn
  4. Clj

This way, Clojure source files are the "most powerful": jobs defined there would override those in Yaml. It would also be possible to refer to jobs declared in yaml from the clj script.