ci: fixed typos + params for os/arch

Signed-off-by: Sam Alba <samalba@users.noreply.github.com>
This commit is contained in:
Sam Alba 2022-02-10 16:09:08 -08:00
parent 7ecf0a97ad
commit 679bb30148

View File

@ -1,6 +1,8 @@
package main package main
import ( import (
"strings"
// "dagger.io/dagger" // "dagger.io/dagger"
"dagger.io/dagger/engine" "dagger.io/dagger/engine"
@ -10,6 +12,10 @@ import (
engine.#Plan & { engine.#Plan & {
inputs: { inputs: {
params: { params: {
// FIXME: until we support a better way
os: string | *"darwin"
arch: string | *"amd64"
// FIXME: implement condition actions using params // FIXME: implement condition actions using params
} }
@ -32,20 +38,21 @@ engine.#Plan & {
build: bash.#Run & { build: bash.#Run & {
input: images.goBuilder.output input: images.goBuilder.output
env: {
GOMODCACHE: mounts["go mod cache"].dest
GOOS: strings.ToLower(inputs.params.os)
GOARCH: strings.ToLower(inputs.params.arch)
}
script: contents: #""" script: contents: #"""
export GOMODCACHE=/gomodcache
mkdir -p /build mkdir -p /build
git_revision=$(git rev-parse --short HEAD) git_revision=$(git rev-parse --short HEAD)
GO_ENABLED=0 \ CGO_ENABLED=0 \
go build -v -o /build/dagger \ go build -v -o /build/dagger \
-ldflags '-s -w -X go.dagger.io/dagger/version.Revision='${git_revision} \ -ldflags '-s -w -X go.dagger.io/dagger/version.Revision='${git_revision} \
./cmd/dagger/ ./cmd/dagger/
"""# """#
export: directories: "/build": _
workdir: "/usr/src/dagger"
env: GOMODCACHE: "/gomodcache"
mounts: { mounts: {
"dagger source code": { "dagger source code": {
contents: inputs.directories.source.contents contents: inputs.directories.source.contents
@ -59,6 +66,7 @@ engine.#Plan & {
} }
workdir: mounts["dagger source code"].dest workdir: mounts["dagger source code"].dest
export: directories: "/build": _
} }
} }
} }