forked from keptn/lifecycle-toolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add example for python task definition (keptn#1554)
Signed-off-by: realanna <[email protected]>
- Loading branch information
1 parent
e5faa75
commit d5e24b2
Showing
2 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
operator/config/samples/python_execution/taskdefinition_pyfunction_recursive.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
apiVersion: lifecycle.keptn.sh/v1alpha3 | ||
kind: KeptnTaskDefinition | ||
metadata: | ||
name: scheduled-deployment-2 | ||
spec: | ||
python: | ||
parameters: | ||
map: | ||
mydata: "my-other-data" | ||
functionRef: | ||
name: scheduled-deployment-inline |
31 changes: 31 additions & 0 deletions
31
operator/config/samples/python_execution/taskdefinition_pyfunction_use_envvars.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: mysecret | ||
type: Opaque | ||
data: | ||
SECURE_DATA: dG9rZW46IG15dG9rZW4= | ||
--- | ||
apiVersion: lifecycle.keptn.sh/v1alpha3 | ||
kind: KeptnTaskDefinition | ||
metadata: | ||
name: pre-deployment-hello | ||
annotations: | ||
python: test | ||
spec: | ||
python: | ||
parameters: | ||
map: | ||
user: "myuser" | ||
secureParameters: | ||
secret: mysecret | ||
cmdParameters: "-h" | ||
inline: | ||
code: | | ||
import os | ||
import yaml | ||
data = os.getenv('DATA') | ||
dct = yaml.safe_load(data) | ||
USER= dct['user'] | ||
PASSWORD = os.environ.get('SECURE_DATA') | ||
print(USER,PASSWORD) |