-
Notifications
You must be signed in to change notification settings - Fork 557
/
main.cue
61 lines (52 loc) · 998 Bytes
/
main.cue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// A dagger workflow to develop dagger
package main
import (
"alpha.dagger.io/dagger"
"alpha.dagger.io/os"
"alpha.dagger.io/go"
)
// Dagger source code
source: dagger.#Artifact @dagger(input)
test: {
// Go unit tests
unit: {
logs: (os.#File & {
from: build.ctr
path: "/test.log"
read: format: "string"
}).read.data
}
// Full suite of bats integration tests
integration: {
// FIXME
}
}
// Build the dagger binaries
build: {
ctr: go.#Container & {
"source": source
setup: [
"apk add --no-cache file",
]
command: """
go test -v ./... > /test.log
go build -o /binaries/ ./cmd/... > /build.log
"""
}
binaries: os.#Dir & {
from: ctr
path: "/binaries"
}
logs: (os.#File & {
from: ctr
path: "/build.log"
read: format: "string"
}).read.data
}
// Execute `dagger help`
usage: os.#Container & {
command: "dagger help"
let binpath = "/usr/local/dagger/bin"
mount: "\(binpath)": from: build.binaries
shell: search: "\(binpath)": true
}