-
Notifications
You must be signed in to change notification settings - Fork 924
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reusable Travis CI setup #99
Comments
That is a good idea, setting up CI should really be easier. I wonder if a cli wrapper is the appropriate way to do this, though - we'd end up with In my mind the current CI script concerns itself with determining the appropriate commit ranges for a (Travis) CI environment. Perhaps a tool that does exactly that and plugs nicely into commit-range # detects CI environments automatically?
{from: 'a9385', to: 'e2357'}
# this api is just my cranky first shot
commitlint --range $(commit-range) Let me know what you think! |
I am probably missing something, but I wonder why the script is so complicated? Shouldn't only |
@felixfbecker If recall correctly there were unsolved issues with |
That can be worked around with by doing |
I like the idea of the standalone commit-range "calculator" and |
So far I came up with following simplification: apiaryio/dredd-transactions#116 #!/bin/bash
set -e
git remote set-branches origin master
git fetch --unshallow --quiet
git checkout master --quiet
git checkout - --quiet
./node_modules/.bin/commitlint --from=master --to="$TRAVIS_COMMIT" I'm not sure whether this can be further simplified, but it seems to work for all the scenarios when I played with it. |
@honzajavorek what if the PR base is not master? |
That's good point. Doesn't happen very often, but happens to me as well 🤔 I guess using sth like |
Hey, I took your improved script @honzajavorek and ran with it here: Contrary to what I wrote in https://github.com/marionebl/commitlint/issues/99#issuecomment-338120450, I went with a spoecialized Some code review on that PR would be super nice 🙇 It is intended to be used with zero configuration. I wonder if you would be interested in testing out a prerelease of this @honzajavorek @felixfbecker. |
I would definitely test this! Didn't use commitlint so far for just this reason - I don't want to have a big bash script in every repo. |
Hey there, you can try this via
# travis.yml
script:
- commitlint-travis
- npm test |
First issue detected |
I am a bit worried about the versioning - does this mean that the version of script:
- commitlint --range $(commitlint-travis) |
another issue run across:
E.G. https://travis-ci.org/marionebl/commitlint/jobs/306896748#L636-L666 |
@ChristianMurphy I believe this is related to the commit being unavailable locally, will require special handling of fork PR commits |
@felixfbecker Yes, I intended to couple |
My fear is that a new version of commit-cli is released but travis-cli is still depending on the older version. Or when I get a Greenkeeper update, I don't actually get a changelog in the PR, because the only real update happened in the other dependency. Besides, this tool could have use cases for more than commit-cli - it can just be a standalone CLI that reads travis env vars and outputs a git commit range on stdout. No need to couple them together. |
@ChristianMurphy @honzajavorek @felixfbecker I released a refactored version of The refactored version now uses I'll do testing via local usage here, feedback from your repos would be very welcome! |
@felixfbecker Okay, understood. I'll reconsider this when |
My understanding is: Lerna takes care of keeping the |
@marionebl I'm sorry for not helping yet, there have been some vacations etc. I'm glad this moves forward and I'll try to do my best to try the new tool out ASAP to provide feedback. |
…t/npm_and_yarn/lodash.template-4.5.0 chore(deps): bump lodash.template from 4.4.0 to 4.5.0
Thanks for commitlint and for the CI setup tutorial! I like the pre-prepared shell script, which counts with all the possibilities which can happen when using GitHub and Travis CI, but currently I can only use it as part of my project by copy-pasting from the docs.
Since it's not two lines, but a bunch of them, many if/elses included, I'm wondering whether it would make sense to turn it into a separate package. I want to install commitlint on multiple repositories and I believe being able to do just sth like
npm i commitlint-travis --save-dev
instead of copy-pasting the script would make the maintenance of the repos easier as well as doing any updates if e.g. Travis CI or GitHub make any changes and the flow breaks.What do you think? I'm happy to help.
The text was updated successfully, but these errors were encountered: