Skip to content

Commit

Permalink
docs: review keptntaskdefinition examples (#3085)
Browse files Browse the repository at this point in the history
Signed-off-by: RealAnna <[email protected]>
  • Loading branch information
RealAnna authored Feb 26, 2024
1 parent bf78974 commit d0a0c43
Show file tree
Hide file tree
Showing 16 changed files with 252 additions and 245 deletions.
1 change: 0 additions & 1 deletion .github/actions/spelling/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,6 @@ moq
mowies
mpod
multigroup
multipe
mutatingwebhookconfigurations
mwc
mwh
Expand Down
1 change: 0 additions & 1 deletion .markdownlint-cli2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ config:
allowed_elements:
- details
- summary
- a
github-admonition: true
max-one-sentence-per-line: true

Expand Down
29 changes: 29 additions & 0 deletions docs/docs/assets/crd/deno-context.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: v1
kind: Secret
metadata:
name: mysecret
type: Opaque
data:
SECURE_DATA: dG9rZW46IG15dG9rZW4=
---
apiVersion: lifecycle.keptn.sh/v1beta1
kind: KeptnTaskDefinition
metadata:
name: pre-deployment-hello
annotations: ## accessible via "KEPTN_CONTEXT"
my: test
spec:
deno:
parameters: ## accessible via "DATA"
map:
user: "myuser"
secureParameters: ## accessible via "SECURE_DATA"
secret: mysecret
inline:
code: |
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);
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: KeptnTaskDefinition
metadata:
name: scheduled-deployment
spec:
function:
deno:
configMapRef:
name: scheduled-deployment-cm-1
---
Expand Down

This file was deleted.

11 changes: 9 additions & 2 deletions docs/docs/guides/tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,15 @@ your workloads and tasks in a `KeptnApp` (for instance a commit ID value).
To do so, the metadata needs to be specified for the workload or for the application.
Follow our guide on [Context and Metadata here](./metadata.md).

For an example of how to access the `KEPTN_CONTEXT`, follow our
[reference page](../reference/crd-reference/taskdefinition.md#example-6-accessing-keptn_context-environment-variable-in-a-deno-task)
<!-- markdownlint-disable MD046 max-one-sentence-per-line-->

!!! note

For an example of how to access the `KEPTN_CONTEXT`, follow our reference page examples
[for deno](../reference/crd-reference/taskdefinition.md#accessing-keptn_context-in-a-deno-task)
and [for python](../reference/crd-reference/taskdefinition.md#accessing-keptn_context-in-a-python-task).

<!-- markdownlint-enable MD046 max-one-sentence-per-line-->

## Parameterized functions

Expand Down
Loading

0 comments on commit d0a0c43

Please sign in to comment.