-
Notifications
You must be signed in to change notification settings - Fork 0
/
dagger.cue
48 lines (42 loc) · 960 Bytes
/
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
package main
import (
"strings"
"dagger.io/dagger"
"universe.dagger.io/docker"
"universe.dagger.io/docker/cli"
)
// This action builds a docker image from a python app.
// Build steps are defined in an inline Dockerfile.
#Build: docker.#Dockerfile & {
}
// Example usage in a plan
dagger.#Plan & {
client: {
filesystem: "./": read: contents: dagger.#FS
network: "unix:///var/run/docker.sock": connect: dagger.#Socket
commands: {
gitref: {
name: "git"
args: ["rev-parse", "HEAD"]
}
}
}
actions: {
_image: "yolean/gcs-stats-prometheus"
_gitref: {
tag: strings.TrimSpace(client.commands.gitref.stdout)
}
build: #Build & {
source: client.filesystem."./".read.contents
}
push: docker.#Push & {
image: build.output
dest: "\(_image):\(_gitref.tag)"
}
load: cli.#Load & {
image: build.output
host: client.network."unix:///var/run/docker.sock".connect
tag: "\(_image):\(_gitref.tag)"
}
}
}