From 577c83f4e08c7d849b44e30a760d45bb47c4d93a Mon Sep 17 00:00:00 2001 From: Gerhard Lazu Date: Thu, 17 Mar 2022 19:11:59 +0000 Subject: [PATCH] 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 --- .../examples/helloworld/main.cue | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 pkg/universe.dagger.io/examples/helloworld/main.cue diff --git a/pkg/universe.dagger.io/examples/helloworld/main.cue b/pkg/universe.dagger.io/examples/helloworld/main.cue new file mode 100644 index 00000000..4fbf1911 --- /dev/null +++ b/pkg/universe.dagger.io/examples/helloworld/main.cue @@ -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 + } + } +}