From a075d94310eaef078a2a04269c6bc50b2bbf77c9 Mon Sep 17 00:00:00 2001 From: johnathanvidu Date: Sun, 9 Feb 2025 15:36:03 +0200 Subject: [PATCH 1/3] Update shell-grain.md --- .../blueprints/shell-grain.md | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/docs/blueprint-designer-guide/blueprints/shell-grain.md b/docs/blueprint-designer-guide/blueprints/shell-grain.md index 19634cae3..ef1ed6ff5 100644 --- a/docs/blueprint-designer-guide/blueprints/shell-grain.md +++ b/docs/blueprint-designer-guide/blueprints/shell-grain.md @@ -271,3 +271,28 @@ grains: - name: cleanup-task command: 'source clean-something.sh' ``` +#### Using Multiline Shell Commands in YAML +When using multiline shell commands in YAML, you can use the >- syntax to indicate that the content is a folded block scalar. Each line should end with a semicolon (;), double ampersand (&&), or double vertical bar (||) to ensure the commands are executed correctly. For example: + +```yaml +grains: + validate: + kind: shell + spec: + agent: + name: kubernetes-testing1 + activities: + deploy: + commands: + - >- # you can use this syntax in the commands sections + apt-get -y install git unzip curl && + git clone {{ .inputs.repoUrl }} && + curl https://get.datree.io | /bin/bash && + datree test {{.inputs.repoName}}/{{.inputs.filePath}} + destroy: + commands: + - name: my_script + command: >- # or like so in the command section + curl https://get.datree.io | /bin/bash ; + source script.sh {{ .inputs.script_input1 }} +``` From 07f4918d1fd5d55dfae9bd920c43016fded32dfe Mon Sep 17 00:00:00 2001 From: johnathanvidu Date: Sun, 9 Feb 2025 15:39:54 +0200 Subject: [PATCH 2/3] spellcheck fixes --- .wordlist.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.wordlist.txt b/.wordlist.txt index f83154de1..486af4021 100644 --- a/.wordlist.txt +++ b/.wordlist.txt @@ -497,3 +497,6 @@ referenceable unpublish Unpublishing Unpublish +workspaces +RoleARN +Multiline \ No newline at end of file From e24819a08a8cca333e4c70234aa5ac2a3299ef0c Mon Sep 17 00:00:00 2001 From: johnathanvidu Date: Sun, 9 Feb 2025 15:40:47 +0200 Subject: [PATCH 3/3] fix spellcheck --- .wordlist.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.wordlist.txt b/.wordlist.txt index 486af4021..598b9da91 100644 --- a/.wordlist.txt +++ b/.wordlist.txt @@ -499,4 +499,5 @@ Unpublishing Unpublish workspaces RoleARN -Multiline \ No newline at end of file +Multiline +multiline \ No newline at end of file