stdlib: improved Docker package
Signed-off-by: Solomon Hykes <sh.github.6811@hykes.org>
This commit is contained in:
1
examples/dagger-dev/dev.cue
Symbolic link
1
examples/dagger-dev/dev.cue
Symbolic link
@@ -0,0 +1 @@
|
||||
../../dev.cue
|
@@ -1,46 +0,0 @@
|
||||
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"]
|
||||
}
|
Reference in New Issue
Block a user