# flightplan-git-deploy
Provides flightplan task for git deploys

# flightplan-git-deploy
Provides a [flightplan](https://github.com/pstadler/flightplan) task for git deploys

## Requirements
* a flightplan compatible `flightplan.js`

## Usage
* Add a `webRoot` property to your target options. Thsi shoudl be the path on the remote server where you want to execute a `git pull`.

There are two methods of using this module:

### Use the standalone `gitDeploy` task
* Add the standalone `gitDeploy` task directly to a flightplan instance
```
// flightplan.js
var plan = require('flightplan');
var gitDeploy = require('flightplan-git-deploy');

plan.target('production', serverConfig, {
    webRoot: '/var/www/project-root'
});

gitDeploy.addToPlan(plan);
```
* `fly gitDeploy:production`

### Use the task as part of another task
* Use in an another flightplan task:
```
// flightplan.js
var plan = require('flightplan');
var gitDeploy = require('flightplan-git-deploy');

plan.target('production', serverConfig, {
    webRoot: '/var/www/project-root'
});

plan.local('customTask', function(local) {
  // some code here
});

plan.remote('customTask', function(remote) {
  // some pre deploy code here
  var webRoot = plan.runtime.options.webRoot;
  gitDeploy.gitPull(remote, webRoot);
  // some post deploy code here
});
```
* `fly customTask:production`

Add usage examples to readme
Add usage examples to readme