-
Notifications
You must be signed in to change notification settings - Fork 0
/
dagger.cue
72 lines (61 loc) · 1.59 KB
/
dagger.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
62
63
64
65
66
67
68
69
70
71
72
package todoapp
import (
"dagger.io/dagger"
"dagger.io/dagger/core"
"universe.dagger.io/yarn"
"universe.dagger.io/bash"
"universe.dagger.io/docker"
)
dagger.#Plan & {
actions: {
// Load the todoapp source code
source: core.#Source & {
path: "."
exclude: [
"node_modules",
"build",
"*.cue",
"*.md",
".git",
]
}
_pull_dotnet: docker.#Pull & {
source: "mcr.microsoft.com/dotnet/sdk:6.0"
}
_checkoutServer: core.#Source & {
path: "Server"
}
// Build client and server
build: {
// Build server
server: bash.#Run & {
input: _pull_dotnet.output
mounts: "server project files": {
contents: _checkoutServer.output
dest: "/server"
}
script: contents: """
ls /server -l
dotnet build /server/Server.fsproj -o ./out
"""
export: directories: "/out": dagger.#FS
}
// Build app
client: yarn.#Script & {
name: "build"
source: actions.source.output
}
}
// Test todoapp
test: yarn.#Script & {
name: "test"
source: actions.source.output
// This environment variable disables watch mode
// in "react-scripts test".
// We don't set it for all commands, because it causes warnings
// to be treated as fatal errors.
// See https://create-react-app.dev/docs/advanced-configuration
container: env: CI: "true"
}
}
}