#Abstracing `dagger call service --source=. up` with an easier to remember command

1 messages · Page 1 of 1 (latest)

sweet remnant
#

I don't want to remember one extra argument (yes i'm veery lazy!) And while dagger call service --source=. up works well I would like to be able to just do dagger call run and the service would just be up and running. The goal is for example to just build the image and run it to test if the service is working.

Is such thing possible?

func (m *AuroraDetector) Service(
    // +defaultPath="."
    source *dagger.Directory,
) *dagger.Service {
    return m.Build(source).
        WithEnvVariable("AURORA_VIDEO_SOURCE", "rtsps://10.20.0.1:7441/nUtRlxvxXC81ul5i?enableSrtp").
        WithExposedPort(8000).
        AsService(dagger.ContainerAsServiceOpts{UseEntrypoint: true})
}

func (m *AuroraDetector) Run(
    ctx context.Context, 
    // +defaultPath="."
    source *dagger.Directory,
) {
    m.Service(source).Up(ctx)    
}