MCPcopy Index your code
hub / github.com/dagger/dagger / ConfigSchema

Method ConfigSchema

toolchains/engine-dev/main.go:362–372  ·  view source on GitHub ↗

Generate the json schema for a dagger config file Currently supported: "dagger.json", "engine.json"

(filename string)

Source from the content-addressed store, hash-verified

360// Generate the json schema for a dagger config file
361// Currently supported: "dagger.json", "engine.json"
362func (dev *EngineDev) ConfigSchema(filename string) *dagger.File {
363 schemaFilename := strings.TrimSuffix(filename, ".json") + ".schema.json"
364 // This tool has runtime dependencies on the engine source code itself
365 return dag.Go(dagger.GoOpts{Source: dev.Source}).
366 Env().
367 WithExec(
368 []string{"go", "run", "./cmd/json-schema", filename},
369 dagger.ContainerWithExecOpts{RedirectStdout: schemaFilename},
370 ).
371 File(schemaFilename)
372}
373
374// Generate any engine-related files
375// Note: this is codegen of the 'go generate' variety, not 'dagger develop'

Callers 1

invokeFunction · 0.45

Calls 4

FileMethod · 0.65
WithExecMethod · 0.45
EnvMethod · 0.45
GoMethod · 0.45

Tested by

no test coverage detected