I am very new to dagger and still confused on how I should structure my pipeline. I have three different repos (frontend, backend, e2e-tests). My rough goal would be:
- When the frontend or backend repo get an update on «main», I would like to trigger the e2e pipeline
- The pipeline needs 4 containers: frontend, backend, database, playwright
- The frontend and backend containers should be built as docker files from the respective repos
- The actual test then basically composes the four containers using withService and runs the tests
Here's the current version of my TypeScript module: https://gist.github.com/stefnnn/6dafdfec0ad035a0cc01820c4255a055
Here are some of my current questions:
-
The e2e-repo has the frontend and backend repo integrated as git submodules. Traditionally I would simply checkout the e2e-repo include submodules and then have all the code available in my pipeline. Is this the way to go with dagger, or should I better directly reference the other repos?
-
When I want to refer to a directory on the host, what's the currently recommended way. Is my current approach of defining a module parameter "dir" ok? To me it doesn't much sense to introduce this parameter, as this is not a reusable module that I want to share with the world, but it seems that's the only way to make a host directory accessible in the module code. However, my @func list_dir doesn't seem to work.
-
How do I build a docker image from a specific Dockerfile in the host directory? What I'm doing in the gist:54 above is obviously not working.
If you can give me some pointers for some of those questions I'd be glad to continue my quest!
. Specifying function paramters is unrelated to whether you plan on sharing the module or not. Dagger function calls are executed in an isolated environment within the context of the Dagger engine, they do not have any host-specific information of where the actual