#Transition to Dagger Functions

1 messages · Page 1 of 1 (latest)

soft pine
#

Most of it boils down to wrapping your existing client code into a mini-server

#

Then dagger itself runs that server in a container

undone rock
#

that might make me more confused 🤯

#

I think of building up dag in functions, passing in some container and params, and then adding on. Then, from a custom CLI, I specify the final product I want, and some args for version/platform and such

#

it's unclear how I might put together build, test-as/with-service, publish

#

are those different functions now? or do I translate my CLI commands to functions? How do I have subcommands?

soft pine
#

I probably don't know enough about your use case do give a perfectly useful answer. But a few thoughts:

  • If you already have a custom CLI acting as a Dagger client, you can wrap that CLI as a function that literally execs that CLI, and it should work.
  • From there, you can create more specialized functions that call your CLI in different ways, with different argument.
  • At some point along the way, you can decide it's not worth executing the intermediary CLI, and you can just import or copy-paste parts of the CLI's code directly into the function