php-censor/docs/en/plugins/shell.md

43 lines
871 B
Markdown
Raw Permalink Normal View History

2016-07-19 11:12:28 +02:00
Plugin Shell
2017-01-04 13:22:20 +01:00
============
2016-07-19 11:12:28 +02:00
2016-07-17 16:20:35 +02:00
Runs a given Shell command.
2016-07-19 11:12:28 +02:00
Configuration
2017-01-04 13:22:20 +01:00
-------------
2016-07-19 11:12:28 +02:00
### Options
2016-07-17 16:20:35 +02:00
* **command** - Required - The shell command to run.
```yml
setup:
shell:
command: "bin/console build"
```
You should understand, that in old configuration type, you can run only one command!
2016-07-19 11:12:28 +02:00
#### New format of Configuration Options
2016-07-17 16:20:35 +02:00
```yml
setup:
shell:
- "[ -d /www ]"
2016-07-17 16:20:35 +02:00
- "chmod u+x %BUILD_PATH%/bin/console"
- "%BUILD_PATH%/bin/console build"
```
When a command fails, the remaining ones are not run.
2016-07-17 16:20:35 +02:00
#### Each new command forgets about what was before
So if you want cd to directory and then run script there, combine those two commands into one like:
```yml
setup:
shell:
- "cd %BUILD_PATH% && php artisan migrate" # Laravel Migrations
```
[See variables which you can use in shell commands](../interpolation.md)