From 679bb301482e7a2da0c3746da434f10b36734dd6 Mon Sep 17 00:00:00 2001 From: Sam Alba Date: Thu, 10 Feb 2022 16:09:08 -0800 Subject: [PATCH] ci: fixed typos + params for os/arch Signed-off-by: Sam Alba --- ci/main.cue | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/ci/main.cue b/ci/main.cue index b06fd4c7..af7bde66 100644 --- a/ci/main.cue +++ b/ci/main.cue @@ -1,6 +1,8 @@ package main import ( + "strings" + // "dagger.io/dagger" "dagger.io/dagger/engine" @@ -10,6 +12,10 @@ import ( engine.#Plan & { inputs: { params: { + // FIXME: until we support a better way + os: string | *"darwin" + arch: string | *"amd64" + // FIXME: implement condition actions using params } @@ -32,20 +38,21 @@ engine.#Plan & { build: bash.#Run & { 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: #""" - export GOMODCACHE=/gomodcache mkdir -p /build git_revision=$(git rev-parse --short HEAD) - GO_ENABLED=0 \ + CGO_ENABLED=0 \ go build -v -o /build/dagger \ -ldflags '-s -w -X go.dagger.io/dagger/version.Revision='${git_revision} \ ./cmd/dagger/ """# - export: directories: "/build": _ - workdir: "/usr/src/dagger" - env: GOMODCACHE: "/gomodcache" - mounts: { "dagger source code": { contents: inputs.directories.source.contents @@ -59,6 +66,7 @@ engine.#Plan & { } workdir: mounts["dagger source code"].dest + export: directories: "/build": _ } } }