Add helloworld example
This is the first thing that someone new to Dagger tried to do. I wanted to capture it in an example so that we can reference in the future. I am sure that we can improve on this small step in a direction that I have seen a new member take. Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
This commit is contained in:
parent
8b7e591851
commit
577c83f4e0
24
pkg/universe.dagger.io/examples/helloworld/main.cue
Normal file
24
pkg/universe.dagger.io/examples/helloworld/main.cue
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
// dagger do hello --log-format=plain
|
||||||
|
//
|
||||||
|
// 9:06AM INF actions._alpine | computing
|
||||||
|
// 9:06AM INF actions._alpine | completed duration=1s
|
||||||
|
// 9:06AM INF actions.hello | computing
|
||||||
|
// 9:06AM INF actions.hello | #3 0.073 hello, world!
|
||||||
|
// 9:06AM INF actions.hello | completed duration=100ms
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"dagger.io/dagger"
|
||||||
|
)
|
||||||
|
|
||||||
|
dagger.#Plan & {
|
||||||
|
actions: {
|
||||||
|
_alpine: dagger.#Pull & {source: "alpine:3"}
|
||||||
|
// Hello world
|
||||||
|
hello: dagger.#Exec & {
|
||||||
|
input: _alpine.output
|
||||||
|
args: ["echo", "hello, world!"]
|
||||||
|
always: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user