drone/drone — pull request #291 by sivel (2014-04-29 02:44:30+00:00)
Title: Add the ability to restrict publish plugins to a specific branch

This pull request adds the ability to restrict running publish plugins to a specific branch. This functionality uses the unused `branch` option that the s3 and swift plugins had already defined. Additionally the option was extended to the PyPI plugin.

An example would be only wanting to publish a file after a successful build/test to the `master` branch. Existing functionality remains unchanged, running publish plugins on all branches if `branch` is not specified.

An example would look like:

```
publish:
swift:
username: someuser
password: 030e39a1278a18828389b194b93211aa
auth_url: https://identity.api.rackspacecloud.com/v2.0
region: DFW
container: drone
source: /tmp/drone.deb
target: latest/drone.deb
branch: master
```

In addition to this change, since `*repo.Repo` is passed down to `publish.Publish.Write` publish plugins in the future could utilize all information provided by the Repo struct by passing it in to the individual plugins `Write` method.

This could also be extended to deployment plugins, notification plugins, etc...I don't have a use case at the moment outside of publish plugins, so for now I've restricted it to that.