Skip to content

Commit

Permalink
Issue F1bonacc1#156: multiline commands documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
F1bonacc1 committed Mar 8, 2024
1 parent 9535b80 commit a56cf80
Show file tree
Hide file tree
Showing 2 changed files with 99 additions and 1 deletion.
47 changes: 47 additions & 0 deletions issues/issue_156/process-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
version: "0.5"
log_level: info
log_length: 300

processes:
block_folded:
command: >
echo 1
&& echo 2
echo 3
block_literal:
command: |
echo 4
echo 5
depends_on:
block_folded:
condition: process_completed

flow_single:
command: 'echo 6
&& echo 7
echo 8'
depends_on:
block_literal:
condition: process_completed

flow_double:
command: "echo 8
&& echo 9
echo 10"
depends_on:
flow_single:
condition: process_completed

flow_plain:
command: echo 11
&& echo 12

echo 13
depends_on:
flow_double:
condition: process_completed

53 changes: 52 additions & 1 deletion www/docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ processes:
command: '[ $(docker inspect -f {{ "{{.State.Running}}" }} nginx_test) = true ]'
```

> :bulb: For backward compatibility, if neither global or local variables exist in `process-compose.yaml` the template engine won't run.
> :bulb: For backward compatibility, if neither global nor local variables exist in `process-compose.yaml` the template engine won't run.

## Specify which configuration files to use

Expand Down Expand Up @@ -254,3 +254,54 @@ processes:
```

> :bulb: `STDIN` and `Windows` are not supported at this time.

#### Multiline Command Support
Process Compose respects all the multiline `YAML` [specification](https://yaml-multiline.info/) variations.

Examples:

```yaml
processes:
block_folded:
command: >
echo 1
&& echo 2
echo 3
block_literal:
command: |
echo 4
echo 5
depends_on:
block_folded:
condition: process_completed
flow_single:
command: 'echo 6
&& echo 7
echo 8'
depends_on:
block_literal:
condition: process_completed
flow_double:
command: "echo 9
&& echo 10
echo 11"
depends_on:
flow_single:
condition: process_completed
flow_plain:
command: echo 12
&& echo 13
echo 14
depends_on:
flow_double:
condition: process_completed
```
> :bulb: The extra blank lines (`\n`) in the command sting are to introduce a newline to the command.

0 comments on commit a56cf80

Please sign in to comment.