Skip to content

Commit

Permalink
Add examples, fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
RetGal committed Sep 2, 2024
1 parent a9162fe commit 0668647
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
25 changes: 24 additions & 1 deletion content/en/docs/01/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,23 @@ dagger call --mod github.com/shykes/daggerverse/hello@v0.3.0 hello --name=sun
To pass a Boolean argument to a Dagger Function, simply add the corresponding flag:

* To set the argument to true: `--foo=true`, or simply `--foo`
* To set the argument to false: `--foo=false`
* To set the argument to false: `--foo=false`, or just omit the argument as the default is usually false

```bash
# true
# explicit
dagger call --mod github.com/shykes/daggerverse/hello@v0.3.0 hello --shout=true
# implicit
dagger call --mod github.com/shykes/daggerverse/hello@v0.3.0 hello --shout
```

```bash
# false
# explicit
dagger call --mod github.com/shykes/daggerverse/hello@v0.3.0 hello --shout=false
# implicit
dagger call --mod github.com/shykes/daggerverse/hello@v0.3.0 hello
```


#### Directory Arguments
Expand All @@ -135,6 +151,13 @@ You can also pass a Directory argument. To do so, add the corresponding flag, fo
In **both** cases, the `dagger` CLI will convert it to an object referencing the contents of that filesystem path or Git repository location,
and pass the resulting `Directory` object as argument to the Dagger Function.

```bash
# filesystem path
dagger call --mod github.com/softwaredevelop/daggerverse/shellcheck@3872d4fb4e5b0e8a2844b2148ea00c076396a53b check --source=/usr/bin
# Git repository
dagger call --mod github.com/softwaredevelop/daggerverse/shellcheck@3872d4fb4e5b0e8a2844b2148ea00c076396a53b check --source=https://github.com/puzzle/action-owasp-dependecy-track-check
```


#### Container Arguments

Expand Down
2 changes: 1 addition & 1 deletion content/en/docs/04/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ But after what we learned previously, we will, of course, use the functions of t
### Extending our codebase

The Trivy Module has a `container()` function, which expects [Container](https://docs.dagger.io/api/reference/#definition-Container) as argument.
As our existing `frontend()` and `backend()` return [Service](https://docs.dagger.io/api/reference/#definition-Service)s, we need an additional functions.
As our existing `frontend()` and `backend()` return a [Service](https://docs.dagger.io/api/reference/#definition-Service), we need an additional functions.

Since the only difference in creating these containers is the path in which they are built, we will combine them into a single function:

Expand Down

0 comments on commit 0668647

Please sign in to comment.