next-update-travis
v1.7.1
Published
Safely update your dependencies using TravisCI cron jobs
Downloads
112
Maintainers
Readme
next-update-travis
Safely update your dependencies using TravisCI cron jobs
Install
Requires Node version 4 or above.
npm install --save-dev next-update-travis
This will create file next-update-travis.sh
you can tweak. If you need to
reinstall (because new version of next-update-travis
is available), just
remove the file and install again
rm next-update-travis.sh
npm i next-update-travis
It is highly recommended to set up next-update-travis
after
enabling semantic release on Travis CI.
Use
Take any Node project and install next-update-travis
as a dev dependency.
This will create a shell script file next-update-travis.sh
in the project.
Add this script to your .travis.yml
script
step.
script:
- ./next-update-travis.sh
- npm test
Then enable a cron job on Travis. next-update-travis.sh
skips
running its command automatically for non-cron jobs.
That's it.
Important
If there are dependencies that the next-update-travis.sh
could safely
upgrade, it will commit and push the change back to GitHub using GH_TOKEN
for authentication. The simplest way to set this token is by using
semantic-release, see it's setup.
Cron job will run, and if dependencies can be successfully upgraded, the update will be pushed (triggering normal Travis build). It will look something like this in the build history
Options
You can tweak which updates are checked by editing next-update-travis.sh
script. Under the hood it uses next-update to check dependencies.
For example, to only consider patches (fixes) you can modify the shell command
to be
next-update --allow patch
Badge
Let other people know that your module is periodically updated with this Markdown SVG badge . You can use "daily", "weekly" and "monthly" period (to match what you have picked as Travis Cron job frequency)
[![next-update-travis badge][nut-badge]][nut-readme]
[nut-badge]: https://img.shields.io/badge/next--update--travis-weekly-green.svg
[nut-readme]: https://github.com/bahmutov/next-update-travis#readme
FAQ
Small print
Author: Gleb Bahmutov <[email protected]> © 2017
License: MIT - do anything with the code, but don't blame me if it does not work.
Support: if you find any problems with this module, email / tweet / open issue on Github
MIT License
Copyright (c) 2017 Gleb Bahmutov <[email protected]>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.