ci: ported config to new client API
Signed-off-by: Sam Alba <samalba@users.noreply.github.com>
This commit is contained in:
parent
5767721478
commit
637a3c9efd
1
ci/cue.mod/module.cue
Normal file
1
ci/cue.mod/module.cue
Normal file
@ -0,0 +1 @@
|
|||||||
|
module: ""
|
1
ci/cue.mod/pkg/dagger.io
Symbolic link
1
ci/cue.mod/pkg/dagger.io
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../../pkg/dagger.io
|
1
ci/cue.mod/pkg/universe.dagger.io
Symbolic link
1
ci/cue.mod/pkg/universe.dagger.io
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../../pkg/universe.dagger.io
|
40
ci/main.cue
40
ci/main.cue
@ -1,8 +1,6 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"strings"
|
|
||||||
|
|
||||||
"dagger.io/dagger"
|
"dagger.io/dagger"
|
||||||
"universe.dagger.io/bash"
|
"universe.dagger.io/bash"
|
||||||
)
|
)
|
||||||
@ -13,28 +11,14 @@ dagger.#Plan & {
|
|||||||
// to avoid the performance hit caused by qemu (linter goes from <3s to >3m when arch is x86)
|
// to avoid the performance hit caused by qemu (linter goes from <3s to >3m when arch is x86)
|
||||||
platform: "linux/aarch64"
|
platform: "linux/aarch64"
|
||||||
|
|
||||||
inputs: {
|
client: filesystem: {
|
||||||
params: {
|
"../": read: exclude: [
|
||||||
// FIXME: until we support a better way
|
"ci",
|
||||||
os: string | *"darwin"
|
"node_modules",
|
||||||
arch: string | *"amd64"
|
"cmd/dagger/dagger",
|
||||||
|
"cmd/dagger/dagger-debug",
|
||||||
// FIXME: implement condition actions using params until we have a
|
]
|
||||||
// better way to select specific actions
|
"./build": write: contents: actions.build.export.directories["/build"]
|
||||||
}
|
|
||||||
|
|
||||||
directories: {
|
|
||||||
// dagger repository
|
|
||||||
source: {
|
|
||||||
path: "../"
|
|
||||||
exclude: ["./ci"]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
outputs: directories: "go binaries": {
|
|
||||||
contents: actions.goBuild.export.directories["/build"]
|
|
||||||
dest: "./build"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
@ -50,7 +34,7 @@ dagger.#Plan & {
|
|||||||
|
|
||||||
_mountSourceCode: {
|
_mountSourceCode: {
|
||||||
mounts: "dagger source code": {
|
mounts: "dagger source code": {
|
||||||
contents: inputs.directories.source.contents
|
contents: client.filesystem."../".read.contents
|
||||||
dest: "/usr/src/dagger"
|
dest: "/usr/src/dagger"
|
||||||
}
|
}
|
||||||
workdir: mounts["dagger source code"].dest
|
workdir: mounts["dagger source code"].dest
|
||||||
@ -60,15 +44,15 @@ dagger.#Plan & {
|
|||||||
|
|
||||||
// Go build the dagger binary
|
// Go build the dagger binary
|
||||||
// depends on goLint and goTest to complete successfully
|
// depends on goLint and goTest to complete successfully
|
||||||
goBuild: bash.#Run & {
|
build: bash.#Run & {
|
||||||
_mountSourceCode
|
_mountSourceCode
|
||||||
_mountGoCache
|
_mountGoCache
|
||||||
|
|
||||||
input: _baseImages.goBuilder
|
input: _baseImages.goBuilder
|
||||||
|
|
||||||
env: {
|
env: {
|
||||||
GOOS: strings.ToLower(inputs.params.os)
|
GOOS: client.platform.os
|
||||||
GOARCH: strings.ToLower(inputs.params.arch)
|
GOARCH: client.platform.arch
|
||||||
CGO_ENABLED: "0"
|
CGO_ENABLED: "0"
|
||||||
// Makes sure the linter and unit tests complete before starting the build
|
// Makes sure the linter and unit tests complete before starting the build
|
||||||
"__depends_lint": "\(goLint.exit)"
|
"__depends_lint": "\(goLint.exit)"
|
||||||
|
Reference in New Issue
Block a user