Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use mod version #21

Merged
merged 1 commit into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions content/en/docs/01/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ The most common way to call Dagger Functions is using the `dagger` CLI:

```bash
dagger call \
--mod github.com/puzzle/dagger-techlab/mod@0437877e0809d7aef35ea031a3a36eb943876e63 \
--mod github.com/puzzle/dagger-techlab/mod@v1.0.0 \
hello
```

Expand All @@ -73,7 +73,7 @@ Explanation to the dagger CLI call:

* `dagger call`:
* execute the dagger CLI `call` command
* `--mod github.com/puzzle/dagger-techlab/mod@0437877e0809d7aef35ea031a3a36eb943876e63`:
* `--mod github.com/puzzle/dagger-techlab/mod@v1.0.0`:
* `call` command option to use the specified local module (load its functions)
* `hello`:
* execute the `Hello()` function
Expand All @@ -99,15 +99,15 @@ or you can explore its functions using:

```bash
dagger functions \
--mod github.com/puzzle/dagger-techlab/mod@0437877e0809d7aef35ea031a3a36eb943876e63
--mod github.com/puzzle/dagger-techlab/mod@v1.0.0
```

And what about additional arguments of the `Hello()` function?
Let's find out:

```bash
dagger call \
--mod github.com/puzzle/dagger-techlab/mod@0437877e0809d7aef35ea031a3a36eb943876e63 \
--mod github.com/puzzle/dagger-techlab/mod@v1.0.0 \
hello --help
```

Expand All @@ -128,7 +128,7 @@ To pass a String argument to a Dagger Function, append the corresponding flag to

```bash
dagger call \
--mod github.com/puzzle/dagger-techlab/mod@0437877e0809d7aef35ea031a3a36eb943876e63 \
--mod github.com/puzzle/dagger-techlab/mod@v1.0.0 \
hello --name=sun
```

Expand All @@ -145,14 +145,14 @@ True:
```bash
# explicit
dagger call \
--mod github.com/puzzle/dagger-techlab/mod@0437877e0809d7aef35ea031a3a36eb943876e63 \
--mod github.com/puzzle/dagger-techlab/mod@v1.0.0 \
hello --shout=true
```

```bash
# implicit
dagger call \
--mod github.com/puzzle/dagger-techlab/mod@0437877e0809d7aef35ea031a3a36eb943876e63 \
--mod github.com/puzzle/dagger-techlab/mod@v1.0.0 \
hello --shout
```

Expand All @@ -161,14 +161,14 @@ False:
```bash
# explicit
dagger call \
--mod github.com/puzzle/dagger-techlab/mod@0437877e0809d7aef35ea031a3a36eb943876e63 \
--mod github.com/puzzle/dagger-techlab/mod@v1.0.0 \
hello --shout=false
```

```bash
# implicit
dagger call \
--mod github.com/puzzle/dagger-techlab/mod@0437877e0809d7aef35ea031a3a36eb943876e63 \
--mod github.com/puzzle/dagger-techlab/mod@v1.0.0 \
hello
```

Expand All @@ -183,14 +183,14 @@ and pass the resulting `Directory` object as argument to the Dagger Function.
Filesystem path:
```bash
dagger call \
--mod github.com/puzzle/dagger-techlab/mod@0437877e0809d7aef35ea031a3a36eb943876e63 \
--mod github.com/puzzle/dagger-techlab/mod@v1.0.0 \
ls --dir .
```

Git repository:
```bash
dagger call \
--mod github.com/puzzle/dagger-techlab/mod@0437877e0809d7aef35ea031a3a36eb943876e63 \
--mod github.com/puzzle/dagger-techlab/mod@v1.0.0 \
ls --dir https://github.com/puzzle/action-owasp-dependecy-track-check
```

Expand All @@ -203,7 +203,7 @@ The CLI will dynamically pull the image, and pass the resulting `Container` obje

```bash
dagger \
--mod github.com/puzzle/dagger-techlab/mod@0437877e0809d7aef35ea031a3a36eb943876e63 \
--mod github.com/puzzle/dagger-techlab/mod@v1.0.0 \
call os --ctr=alpine:latest
```

Expand Down Expand Up @@ -275,7 +275,7 @@ Call the `Hello()` function so that it returns the phrase `Welcome, sunshine!` i
{{% details title="show solution" mode-switcher="normalexpertmode" %}}
```bash
dagger call \
--mod github.com/puzzle/dagger-techlab/mod@0437877e0809d7aef35ea031a3a36eb943876e63 \
--mod github.com/puzzle/dagger-techlab/mod@v1.0.0 \
hello \
--giant \
--greeting=Welcome \
Expand All @@ -290,15 +290,15 @@ Set the `--password` value in the following call with a secret, using an environ

```bash
dagger call \
--mod github.com/puzzle/dagger-techlab/mod@0437877e0809d7aef35ea031a3a36eb943876e63 \
--mod github.com/puzzle/dagger-techlab/mod@v1.0.0 \
unlock --password=visible
```

{{% details title="show solution" mode-switcher="normalexpertmode" %}}
```bash
export SECRET=MySuperSecret
dagger call \
--mod github.com/puzzle/dagger-techlab/mod@0437877e0809d7aef35ea031a3a36eb943876e63 \
--mod github.com/puzzle/dagger-techlab/mod@v1.0.0 \
unlock --password env:SECRET
```
{{% /details %}}
Expand All @@ -309,7 +309,7 @@ or using a file
```bash
echo $SECRET > secret.txt
dagger call \
--mod github.com/puzzle/dagger-techlab/mod@0437877e0809d7aef35ea031a3a36eb943876e63 \
--mod github.com/puzzle/dagger-techlab/mod@v1.0.0 \
unlock --password file:./secret.txt
```
{{% /details %}}
Expand All @@ -319,7 +319,7 @@ or using a command
{{% details title="show solution" mode-switcher="normalexpertmode" %}}
```bash
dagger call \
--mod github.com/puzzle/dagger-techlab/mod@0437877e0809d7aef35ea031a3a36eb943876e63 \
--mod github.com/puzzle/dagger-techlab/mod@v1.0.0 \
unlock --password cmd:"echo $SECRET"
```
{{% /details %}}
Expand Down
16 changes: 8 additions & 8 deletions content/en/docs/02/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Let's explore them step by step:

```bash
dagger call \
--mod github.com/puzzle/dagger-techlab/mod@0437877e0809d7aef35ea031a3a36eb943876e63 \
--mod github.com/puzzle/dagger-techlab/mod@v1.0.0 \
--help
```

Expand All @@ -40,7 +40,7 @@ dagger call \

```bash
dagger call \
--mod github.com/puzzle/dagger-techlab/mod@0437877e0809d7aef35ea031a3a36eb943876e63 \
--mod github.com/puzzle/dagger-techlab/mod@v1.0.0 \
ssh-service --help
```

Expand All @@ -61,7 +61,7 @@ dagger call \

```bash
dagger call \
--mod github.com/puzzle/dagger-techlab/mod@0437877e0809d7aef35ea031a3a36eb943876e63 \
--mod github.com/puzzle/dagger-techlab/mod@v1.0.0 \
ssh-service up --help
```

Expand All @@ -87,15 +87,15 @@ The `Service` object is returned by the modules `SshService()` function.

```bash
dagger call \
--mod github.com/puzzle/dagger-techlab/mod@0437877e0809d7aef35ea031a3a36eb943876e63 \
--mod github.com/puzzle/dagger-techlab/mod@v1.0.0 \
ssh-service up --ports=22022:22
```

Here we print the contents of a File returned by a Dagger Function, by chaining a call to the `File` objects `Contents()` function:

```bash
dagger call \
--mod github.com/puzzle/dagger-techlab/mod@0437877e0809d7aef35ea031a3a36eb943876e63 \
--mod github.com/puzzle/dagger-techlab/mod@v1.0.0 \
lint --source=https://github.com/puzzle/puzzle-radicale-auth-ldap report contents
```

Expand All @@ -112,7 +112,7 @@ Have a look at the [WithExec()](https://docs.dagger.io/api/reference/#Container-
{{% details title="show solution" mode-switcher="normalexpertmode" %}}
```bash
dagger call \
--mod github.com/puzzle/dagger-techlab/mod@0437877e0809d7aef35ea031a3a36eb943876e63 \
--mod github.com/puzzle/dagger-techlab/mod@v1.0.0 \
wolfi with-exec --args="cat","/etc/os-release" stdout
```
{{% /details %}}
Expand All @@ -122,15 +122,15 @@ Try an alternative approach using [File()](https://docs.dagger.io/api/reference/
{{% details title="show hint" mode-switcher="normalexpertmode" %}}
```bash
dagger call \
--mod github.com/puzzle/dagger-techlab/mod@0437877e0809d7aef35ea031a3a36eb943876e63 \
--mod github.com/puzzle/dagger-techlab/mod@v1.0.0 \
wolfi file --help
```
{{% /details %}}

{{% details title="show solution" mode-switcher="normalexpertmode" %}}
```bash
dagger call \
--mod github.com/puzzle/dagger-techlab/mod@0437877e0809d7aef35ea031a3a36eb943876e63 \
--mod github.com/puzzle/dagger-techlab/mod@v1.0.0 \
wolfi file --path=/etc/os-release contents
```
{{% /details %}}