- PHP +7.2
- Recipe Runner
Create a recipe and add the module to the packages section:
name: "Your recipe"
extra:
rr:
packages:
"recipe-runner/system-module": "1.0.x-dev"Executes a command.
steps:
- actions:
- run: "echo hi user"A command could be split into command and parameters. This way, parameters will be escaped automatically.
steps:
- actions:
run:
command:
"echo" # Command
"hi user" # parameter 1You can also set a timeout and the current working directory
steps:
- actions:
- run:
command: "echo hi user"
timeout: 60
cwd: "/temp"Makes a copy of a single file.
steps:
- actions:
- copy_file:
from: "/dir1/file.txt"
to: "/tmp/file.txt"Download a file from network.
steps:
- actions:
- download_file:
url: "https://phar.phpunit.de/phpunit-8.phar"
filename: "phpunit.phar"Makes a directory recursively. On POSIX filesystems, directories are created with a default mode value 0777.
steps:
- actions:
- make_dir: "/dir1"or you can set the directory mode with the parameter mode
steps:
- actions:
- make_dir:
dir: "/dir1"
mode: 0777Copies all the contents of the source directory into the target one.
steps:
- actions:
- mirror_dir:
from: "/dir1"
to: "/tmp"Reads the content of a file or URL address.
steps:
- actions:
- read_file: "/tmp/hi.txt"
register: "file_content"File content available at content:
registered["file_content"]["content"]
## or
registered.get('file_content.content')Deletes files, directories and symlinks.
steps:
- actions:
- remove: "/tmp/hi.txt"or
steps:
- actions:
- remove:
- "/tmp/hi.txt"
- "/dir1"
- "/home/user/symlink1.sh"Saves the given contents into a file.
steps:
- actions:
- write_file:
filename: "/tmp/hi.txt"
content: "hi user"The preferred installation method is Composer:
composer require recipe-runner/system-moduleYou can run the unit tests with the following command:
$ cd system-module
$ composer testThis library is open-sourced software licensed under the MIT license.