This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
dagger/examples/dagger-dev/main.cue
Solomon Hykes 6460a5c9fc Rename dagger.#Dir to dagger.#Artifact
Signed-off-by: Solomon Hykes <sh.github.6811@hykes.org>
2021-03-13 00:11:59 -08:00

47 lines
930 B
CUE

package main
// A dagger configuration to build and test the dagger source code.
// This configuration can easily be adapted to build and test any go project.
//
//
// Example:
// dagger compute ./examples/dagger-dev --input-dir repository=/path/to/go/project
import (
"dagger.io/dagger"
"dagger.io/go"
"dagger.io/docker"
)
repository: dagger.#Artifact
// Build `dagger` using Go
build: go.#Build & {
source: repository
packages: "./cmd/dagger"
output: "/usr/local/bin/dagger"
}
// Run go tests
test: go.#Test & {
source: repository
packages: "./..."
}
// Run a command with the binary we just built
help: docker.#Run & {
image: build
args: ["dagger", "-h"]
}
// Build dagger using the (included) Dockerfile
buildWithDocker: docker.#Build & {
source: repository
}
// Run a command in the docker image we just built
helpFromDocker: docker.#Run & {
image: buildWithDocker.image
args: ["dagger", "-h"]
}