melix/gradle-cf-plugin — pull request #2 by springyboing (2012-11-20 19:09:16+00:00)
Title: Created deploy task to push or update application

Hey,

This is a new task I created to make automating a deployment easier. If the application already exists on CF then it executes the Update task, otherwise it executes the Push task.

With this I wanted to make service binding a breeze. So now on the Update task, services only bind if the name is specified and already created on CF. It checks for services on CF, only binding if they exist. It doesn't unbind services not specified in the gradle script, but this wouldn't be hard to add if needs be. I'm taking the non-destructive approach.

Also updated Push & Update tasks to use a duplicate free list of URIs to map to. This also makes sure all the URIs are strings. GStrings don't get cast to Strings which can cause an issue.

Finally made adding a service e.g. calling cf-add-service, an idempotent operation. Meaning if you already have the service it won't create it again or blow up because it already exists. This allows automation of service creation before the Deploy task using a doFirst configuration as documented in the README.md possible.

Hope you think its a worth while addition.

Tim.