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

docs: mention KEPTN_CONTEXT env var in runtime readmes files #2588

Merged
merged 3 commits into from
Nov 28, 2023
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
15 changes: 11 additions & 4 deletions runtimes/deno-runtime/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,24 @@ The Keptn deno runtime uses [Deno](https://deno.com/)
to execute Javascript/Typescript code.
Keptn uses this runtime to run [KeptnTask](https://lifecycle.keptn.sh/docs/tasks/write-tasks/)
for pre- and post-checks.
Keptn passes parameters of `KeptnTask`s and
[Context](https://lifecycle.keptn.sh/docs/concepts/tasks/#context) information
to the runtime via the special environmental variable `DATA`.
It also supports mounting Kubernetes secrets making them accessible via the `SECURE_DATA` env var.

### Environment Variables

Keptn passes the following environment variables to the runtime:

* `DATA`: JSON encoded object containing the parameters specified in `spec.parameters` of a `KeptnTask`.
* `SECURE_DATA`: Contains the value of the secret referenced in the `spec.secureParameters` field of a `KeptnTask`.
* `KEPTN_CONTEXT`: JSON encoded object containing context information for the task.

You can then read the data with the following snippet of code.

```js
const data = Deno.env.get("DATA")!;
const secret = Deno.env.get("SECURE_DATA")!;
const context = Deno.env.get("KEPTN_CONTEXT")!;
console.log(data);
console.log(secret);
console.log(context);
```

`KeptnTask`s can be tested locally with the runtime using the following command.
Expand Down
8 changes: 8 additions & 0 deletions runtimes/python-runtime/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,11 @@ We can call the hellopy.py script downloading it directly from github
```shell
docker run -e "SCRIPT=https://raw.githubusercontent.com/keptn/lifecycle-toolkit/main/runtimes/python-runtime/samples/hellopy.py" -it lifecycle-toolkit/runtimes/python-runtime:${VERSION}
```

### Environment Variables

Keptn passes the following environment variables to the runtime:

* `DATA`: JSON encoded object containing the parameters specified in `spec.parameters` of a `KeptnTask`.
* `SECURE_DATA`: Contains the value of the secret referenced in the `spec.secureParameters` field of a `KeptnTask`.
* `KEPTN_CONTEXT`: JSON encoded object containing context information for the task.
Loading