Skip to content

tlvince/conditional-travis-deploy

Repository files navigation

conditional-travis-deploy

Build Status npm version License

Generic conditions for TravisCI deployment

Intended to be used within Travis's before_deploy block. Tries to determine which build/deployment type to perform based on the following conventions:

  • Pushes to develop: deploy to development
  • Pushes to master: deploy to staging
  • Tags: deploy to production

Throw on all other triggers.

Installation

npm install --save conditional-travis-deploy

Usage

var conditionalTravisDeploy = require('conditional-travis-deploy')
console.log(conditionalTravisDeploy)
//=> production

CLI

conditional-travis-deploy
#=> Error: TravisCI not found in process.env
echo $?
#=> 1

TRAVIS=true TRAVIS_BRANCH=master conditional-travis-deploy
#=> staging

Author

© 2016 Tom Vincent git@tlvince.com (https://tlvince.com)

License

Released under the MIT license.

About

Generic conditions for TravisCI deployment

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published