-
Notifications
You must be signed in to change notification settings - Fork 72
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
AppVeyor CI Integration 2 (monorepo update) #142
Conversation
462fc31
to
6683044
Compare
ci-services/appveyor.js
Outdated
// The Windows equivalent of '2>/dev/null || true' is '2>NUL || (exit 0)' | ||
ignoreOutput: '2>NUL || (exit 0)', | ||
// Multi-line update message because committing with linebreaks does not work. | ||
updateMessage: '-m "chore(package): update lockfile" -m "https://npm.im/greenkeeper-lockfile"' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing updateMessage is necessary. New line characters \n\n don't work in AppVeyor. Here is a failed build when this option is not set: https://ci.appveyor.com/project/patkub/test/build/1.0.5
https://github.com/patkub/greenkeeper-lockfile/tree/appveyor-ci-service-no-update-message
lib/update-lockfile.js
Outdated
const updateMessage = 'chore(package): update lockfile\n\nhttps://npm.im/greenkeeper-lockfile' | ||
exec(`git commit -m "${updateMessage}"`) | ||
const updateMessage = options.updateMessage ? options.updateMessage : '-m "chore(package): update lockfile\n\nhttps://npm.im/greenkeeper-lockfile"' | ||
exec(`git commit ${updateMessage}`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here I'm using the update message defined in the ci-service, if its available.
lib/update-lockfile.js
Outdated
const ignoreOutput = options.ignoreOutput ? options.ignoreOutput : '2>/dev/null || true' | ||
exec(`git add npm-shrinkwrap.json ${ignoreOutput}`) | ||
exec(`git add package-lock.json ${ignoreOutput}`) | ||
exec(`git add yarn.lock ${ignoreOutput}`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here I'm using the ignore output method defined in the ci-service, if its available.
a8a6b92
to
999dc1e
Compare
ignoreOutput option to set the method used to ignore command output when staging the updated lockfile tests for code coverage
999dc1e
to
757144e
Compare
Updated, because it is only necessary to change the way the output is ignored, not the syntax of the commit message. |
e8280f0
to
c644e84
Compare
This now works with monorepo support |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏 💃 ✨
@patkub can you rebase this? |
Update to where I left off with #80. This now works and runs directly on AppVeyor (no need for bash). I added an option to ci-services to change the way command output is ignored to make it compatible.
Pull Request where greenkeeper updated the lockfile:
patkub/test-greenkeeper-lockfile-appveyor#22
Successful branch build where greenkeeper-lockfile updated, committed, and pushed the new lockfile:
https://ci.appveyor.com/project/patkub/test-greenkeeper-lockfile-appveyor/build/1.0.259
Successful build that ran on the PR:
https://ci.appveyor.com/project/patkub/test-greenkeeper-lockfile-appveyor/build/1.0.260
Successful branch build on "chore(package): update lockfile" commit:
https://ci.appveyor.com/project/patkub/test-greenkeeper-lockfile-appveyor/build/1.0.261
Successful build that ran on the PR:
https://ci.appveyor.com/project/patkub/test-greenkeeper-lockfile-appveyor/build/1.0.262
AppVeyor config: https://github.com/patkub/test-greenkeeper-lockfile-appveyor/blob/master/appveyor.yml
Travis jest tests are now passing with 100% coverage.