spring-io/sagan — pull request #337 by cbeams (2014-03-31 16:03:57+00:00)
Title: Support -Pspace=<...> vs. -Pproduction / -Pstaging

Prior to this commit, deployment required specifying

./gradlew deploy -Pproduction # OR
./gradlew deploy -Pstaging

This worked fine, but required unnecessarily complex conditional logic in
deploy.gradle. This change refactors this logic such that -Pspace is required
and the value is treated as the target space. 'production' is treated as a
reserved value and gets special treatment, e.g.:

- 'panda' database instead of default 'hippo'
- 'spring.io' and 'www.spring.io' URIs are mapped, instead of the
default '${space}.spring.io'

If the value of the space property is anything other than 'production', then
the defaults mentioned above apply instead.

If the space property is not present and the build is running on Travis CI,
the implementation now looks to the name of the current git branch to
determine the target space. This allows us to push changes to master in order
to deploy to production, and to push branches named stage-foo, stage-bar, etc
to deploy to staging.

See also #331