-
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
Add Drone.io support #141
Add Drone.io support #141
Conversation
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.
I've been testing by emulating greenkeeper commits at https://beta.drone.io/donny-dont/drone-greenkeeper-test to test the functionality. Should be good to go assuming no additional changes.
* Should update the `package-lock.json` | ||
*/ | ||
function shouldUpdate () { | ||
let re = /^(chore|fix)\(package\): update [^ ]+ to version.*$/mi |
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.
Like Codeship there isn't a good way to get back the current number of commits on the branch so here we're matching the commit message. Might be a good feature request for @bradrydzewski at some point.
ci-services/drone.js
Outdated
// Is this a regular build | ||
correctBuild: env.DRONE_BUILD_EVENT=== 'push', | ||
// Should the lockfile be uploaded from this build | ||
uploadBuild: env.DRONE_JOB_NUMBER.endsWith('1') |
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.
With matrix builds the first build is always 1
.
ci-services/drone.js
Outdated
// i.e. the Greenkeeper commit | ||
firstPush: shouldUpdate(), | ||
// Is this a regular build | ||
correctBuild: env.DRONE_BUILD_EVENT=== 'push', |
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.
Drone has different events for build types in the case of what greenkeeper is up to it would be a push
to the branch.
@janl I wanted to give an update on status. In my test Greenkeeper just gave me this update donny-dont/drone-greenkeeper-test@master...donny-dont:greenkeeper/sinon-5.0.3 and my Drone plugin went ahead and updated the lockfile and then uploadedthe lockfile. Here's the definition of the build in the .drone.yml. pipeline:
greenkeeper_update_lockfile:
image: plugins/greenkeeper
pull: true
update: true
build:
image: node:10-alpine
pull: true
commands:
- npm i -g npm@latest
- npm ci
greenkeeper_lockfile_upload:
image: plugins/greenkeeper
upload: true
secrets:
- source: gh_token
target: gk_token Anyways I think this is ready to go. Let me know if there's anything else you need me to do. |
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.
thank you @donny-dont ! 💯 🌴
🎉 This PR is included in version 1.15.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Adds support for Drone.io which has a hosted solution as well as a service implementation.
cc: @bradrydzewski who is the lead on Drone