Created
March 29, 2015 22:59
-
-
Save kamranayub/88f963a9ac3d5bf6114d to your computer and use it in GitHub Desktop.
Manually trigger Travis CI build for repository
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Travis = require('travis-ci'); | |
// change this | |
var repo = "kamranayub/kamranayub.github.io"; | |
var travis = new Travis({ | |
version: '2.0.0' | |
}); | |
travis.authenticate({ | |
// available through Travis CI | |
// see: http://kamranicus.com/blog/2015/02/26/continuous-deployment-with-travis-ci/ | |
github_token: process.env.GH_TOKEN | |
}, function (err, res) { | |
if (err) { | |
return console.error(err); | |
} | |
travis.repos(repo.split('/')[0], repo.split('/')[1]).builds.get(function (err, res) { | |
if (err) { | |
return console.error(err); | |
} | |
travis.requests.post({ | |
build_id: res.builds[0].id | |
}, function (err, res) { | |
if (err) { | |
return console.error(err); | |
} | |
console.log(res.flash[0].notice); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment