From 65230921c6335592fd64879309c6e5d0f47d2b74 Mon Sep 17 00:00:00 2001 From: Matt Button Date: Sun, 9 Jan 2011 00:47:41 +0000 Subject: [PATCH] Added binary file for easier interaction with minion --- README.md | 20 ++++++++++++++------ minion | 23 +++++++++++++++++++++++ 2 files changed, 37 insertions(+), 6 deletions(-) create mode 100755 minion diff --git a/README.md b/README.md index 8fd667f..8ba4538 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ The system is inspired by ruckusing, which had a nice system for defining tasks ## Requirements -* [kohana-database](https://github.com/kohana/database) +* [kohana-database](https://github.com/kohana/database) is required by the migration tasks ## Compatibility @@ -21,21 +21,29 @@ Minion should be compatible with both Kohana 3.0.x and 3.1.x First off, download and enable the module in your bootstrap -Then you can run minion like so: +Then copy the binary `minion` into your webroot (i.e. the folder where index.php is, edit the binary if you want to store it in a different location) - php index.php --uri=minion/{task} +You can then run minion like so: -To view a list of minion tasks, run + ./minion {task} - php index.php --uri=minion/help +To view a list of minion tasks, run minion without any parameters, or with the `--help` option + + ./minon + ./minion --help To view help for a specific minion task run - php index.php --uri=minion/help/{task} + ./minion {task} --help For security reasons Minion will only run from the cli. Attempting to access it over http will cause a `Kohana_Exception` to be thrown. +If you're unable to use the binary file for whatever reason then simply replace `./minion {task}` in the above +examples with + + php index.php --uri=minion --task={task} + ## Writing your own tasks All minion tasks must be located in `classes/minion/task/`. They can be in any module, thus allowing you to diff --git a/minion b/minion new file mode 100755 index 0000000..68d9a31 --- /dev/null +++ b/minion @@ -0,0 +1,23 @@ +#!/bin/bash +# +# Usage: ./minion [task:name] [--option1=optval1 --option2=optval2] +# +# And so on. +# +# To get help, pass in --help +# +# # Minion general help +# ./minion --help +# ./minion +# +# # Task specific help +# ./minion task:name --help +# + +if [[ $# > 1 && $1 != --* ]] +then + TASK="--task=$1" + shift 1 +fi + +php index.php $TASK $@