Skip to content

Getting started with usher

enygma edited this page Dec 28, 2011 · 5 revisions

This is a HOWTO guide to getting started with the Usher task execution system.

  1. Download the latest Usher code from https://github.com/enygma/usher

  2. Included in the release is a sample configuration file with some basic tasks (config.json-dist). You'll either need to copy this example over to config.json or create a new file. Here's the basic structure of a configuration file:

{
    "project" : {
        "name"          : "My Test Project",
        "author"        : "Chris Cornutt",
        "projectBase"   : "/tmp/projectbase",
        "tasks" : [
        ]
    }
}

The first "project" section provides Usher with some metadata about your current build including the base project path it needs to work with. This base path is considered the "working directory" for several of the tasks.

The "tasks" section is a set of Tasks (from Lib\Task) that do the actual work. You can find some documentation about the current task list here. Here's a few examples:

Creating an internal variable:

{
    "type" : "internal.param",
    "value": "git://github.com/enygma/usher.git",
    "name" : "gitrepo"
}

Building a phar archive:

{
    "type"            : "package.phar",
    "target"          : "/tmp/test.phar",
    "sourceDirectory" : "/tmp/sampleapp",
    "stubFile"        : "index.php"
}

One you've defined your config.json file, you can execute the build by calling the usher command:

./usher

This, in turn, looks for PHP and calls usher.php with it. It will read the config.json file from the local directory and execute each of the tasks.

Clone this wiki locally