Open Stupidism opened 6 years ago
It seems travis now defaults to npm ci
, which means this is much more often a problem.
Traivs CI run: https://travis-ci.org/freaktechnik/github-stub/builds/386634973 .travis.yml: https://github.com/freaktechnik/github-stub/blob/67273161087b04074aa829be1f134dd52088f2ee/.travis.yml
It looks like this will be happening now for all new Greenkeeper PRs with a breaking version change that run on the latest Node. It can be solved by reverting the default script in your .travis.yml
to
install: npm install
I ended up getting the same error message as @Stupidism setting up greenkeeper-lockfile
and digging into the code a little, I'm wondering if the travis.correctBuild
flag at https://github.com/greenkeeperio/greenkeeper-lockfile/blob/master/ci-services/travis.js#L14 should really check if it is a Greenkeeper PR branch.
That's what seems to be happening for some other CI services already (e.g. for Codeship at https://github.com/greenkeeperio/greenkeeper-lockfile/blob/master/ci-services/codeship.js#L33).
Hi @daffl , thanks for jumping in here, that is indeed the way to go for now 👍
We’ve got the problem on our list and will deal with it within the monorepo PR for gk-lockfile that we’re currently working on.
I've created a script that will conditionally use npm install/npm ci on travis ci depending on whether the branch is a greenkeeper branch.
A gist including travis config example. https://gist.github.com/BerkeleyTrue/ff98c0aa27c21e1616f6bf910f444aee
install: case $TRAVIS_BRANCH in greenkeeper*) npm i;; *) npm ci;; esac;
is a one-liner to make the same choice as the script by @BerkeleyTrue directly in the .travis.yml.
For node 9 I had to add:
before_install:
- if [[ `npm -v` != 6* ]]; then npm install -g npm@6; fi
So the full'ish script:
node_js:
- '10'
- '9'
- '8'
before_install:
- if [[ `npm -v` != 6* ]]; then npm install -g npm@6; fi
install: case $TRAVIS_BRANCH in greenkeeper*) npm i;; *) npm ci;; esac;
Any update as to when we can expect a more official fix? Thanks!
I tried in travis and circleci:
But it always complains:
ci scripts: travis circleci
ci results: travis circleci