I'm trying to look into Dagger as a replacement for the content of multiple pipeline types we are using in our company.. Bitbucket-ci, Jenkins but mainly Gitlab-ci.
My company, Qteal, is mainly working in the Embedded SW world, doing mainly the Quality/Testing part.
It's a very common complaint from people in my company that they have to wait a very long time and push multiple changes to test if the pipeline they are developing is working in the CI itself.
Therefore I decided to look into some tools which would be suited for testing all these things localy, rather that having to always rely for the logic on the CI provider.
I've been demoing Dagger a little bit, experimenting, and all looks quite nice. It's still taking getting used to programming my pipelines, but it's a very nice changeup.
My main issue currently, is, how would I be able to run specific parts of a pipeline file from the CLI? But not everything at the same time?
My usecase is as following:
I have 1 ci.py dagger file, which contains a build stage, test stage and deploy stage.
Locally I want to execute specific parts for testing my pipeline developments, or the complete thing.
In the Gitlab-ci we commonly use, I would still like to have my separate stages be visible. E.g. in my pipeline viewer I would still like to see the stages, which in turn would call a specific part of the Dagger pipeline ci.py file.
How would one go about this? Is there a standard Dagger way to do this? The closest thing I saw was The Dagger Plan, but it seems deprecated..
I've been thinking about this:
import anyio
import dagger
import click
async def build():
# dagger impl for build stage
async def test():
# dagger impl for test stage
async def deploy():
# dagger impl for deploy
@click.command()
@click.option('--name', prompt='Stagename',
help='The stage to be executed.')
def runner(name):
anyio.run(eval(name))
if __name__ == '__main__':
runner()
Anyone?