I am trying to get dagger to do codegen programmatically for CI of my "daggerverse". I am getting an error failed to import local module source: context cancelled . Here's the gist of what I'm trying to do
package main
import (
"context"
)
type Ci struct {
//+private
Modules []string
}
func New() *Ci {
modules := []string{
"oauth",
"docker",
"ci",
"maven",
"sonar",
}
return &Ci{Modules: modules}
}
func (ci *Ci) Lint(ctx context.Context, source *Directory) (string, error) {
gen, _ := dag.Docker().From("alpine").
WithWorkdir("/src").
WithMountedDirectory("/src", source).
WithExec([]string{"apk", "add", "curl"}).
WithExec([]string{"sh", "-c", "curl -L https://dl.dagger.io/dagger/install.sh | sh"}).Sync(ctx)
return gen.WithWorkdir(ci.Modules[0]).
WithExec([]string{"../bin/dagger", "develop"}, ContainerWithExecOpts{
ExperimentalPrivilegedNesting: true,
}).
Stdout(ctx)
}
"Docker" is a custom module where I prefix my corp Artifactory url. Which shouldn't affect this. I have stripped the part where I'm trying to do golanglint-ci because the code doesn't even reach it.