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/docs/tests/use-cases/ci-cd-for-go-project/build/dagger.cue

33 lines
541 B
CUE
Raw Normal View History

package main
import (
"dagger.io/dagger"
"universe.dagger.io/go"
)
dagger.#Plan & {
client: {
// Retrieve go source code
filesystem: ".": read: {
contents: dagger.#FS
include: ["go.mod", "go.sum", "**/*.go"]
}
}
actions: {
// Alias to code directory
_code: client.filesystem.".".read.contents
// Improved go base image with useful tool
// Enable cgo by installing build-base
_base: go.#Image & {
packages: "build-base": version: _
}
// Build go project
build: go.#Build & {
source: _code
}
}
}