JSPM

  • Created
  • Published
  • Downloads 15769
  • Score
    100M100P100Q6666F
  • License MIT

run a deployment script only once in the test matrix

Package Exports

  • travis-deploy-once

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (travis-deploy-once) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

travis-deploy-once

Build Status

You want to test as many node versions as possible and deploy if all of them pass. This module allows you do just that in a script running in Travis' after_success hook.

Only the job with the highest node version (i.e. the build leader) will run your script.

npm install --save travis-deploy-once
const deployOnce = require('travis-deploy-once')

try {
  // Options can also be set as environment variables with the same name
  var result = await deployOnce({
    // GitHub oAuth token
    GH_TOKEN: 'asd',
    // Want to control which job is the build leader?
    // Set your preferred job id
    BUILD_LEADER_ID: 1  
  })
} catch (err) {
  // something went wrong, and err will tell you what
}

if (result === true) deployMyThing()
if (result === false) console.log('Some job(s) failed')
if (result === null) console.log('Did not run as the build leader')