From 4edd3391f956fd1288bff8195af2ea74a678cfdc Mon Sep 17 00:00:00 2001 From: Don Date: Thu, 12 Apr 2018 10:50:34 -0700 Subject: [PATCH 1/3] feat: Add Drone.io support --- ci-services/drone.js | 25 +++++++++++++++++++++++++ ci-services/tests.js | 1 + 2 files changed, 26 insertions(+) create mode 100644 ci-services/drone.js diff --git a/ci-services/drone.js b/ci-services/drone.js new file mode 100644 index 00000000..6a235ef4 --- /dev/null +++ b/ci-services/drone.js @@ -0,0 +1,25 @@ +'use strict' + +const env = process.env + +/** + * Should update the `package-lock.json` + */ +function shouldUpdate () { + let re = /^(chore|fix)\(package\): update [^ ]+ to version.*$/mi + return re.test(env.DRONE_COMMIT_MESSAGE) +} + +module.exports = { + // The GitHub repo slug + repoSlug: env.DRONE_REPO, + // The name of the current branch + branchName: env.DRONE_COMMIT_BRANCH, + // Is this the first push on this branch + // i.e. the Greenkeeper commit + firstPush: shouldUpdate(), + // 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') +} diff --git a/ci-services/tests.js b/ci-services/tests.js index d75868a7..9daeae35 100644 --- a/ci-services/tests.js +++ b/ci-services/tests.js @@ -5,6 +5,7 @@ const env = process.env module.exports = { buildkite: () => env.BUILDKITE === 'true', circleci: () => env.CIRCLECI === 'true', + drone: () => env.DRONE === 'true', jenkins: () => env.JENKINS_URL !== undefined, travis: () => env.TRAVIS === 'true', wercker: () => env.WERCKER === 'true', From 128199ff4d59740b183329945b9753504da71fc6 Mon Sep 17 00:00:00 2001 From: Don Date: Thu, 12 Apr 2018 15:58:53 -0700 Subject: [PATCH 2/3] fix(style): run standard --- ci-services/drone.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-services/drone.js b/ci-services/drone.js index 6a235ef4..54a93c8d 100644 --- a/ci-services/drone.js +++ b/ci-services/drone.js @@ -19,7 +19,7 @@ module.exports = { // i.e. the Greenkeeper commit firstPush: shouldUpdate(), // Is this a regular build - correctBuild: env.DRONE_BUILD_EVENT=== 'push', + correctBuild: env.DRONE_BUILD_EVENT === 'push', // Should the lockfile be uploaded from this build uploadBuild: env.DRONE_JOB_NUMBER.endsWith('1') } From ff779c1c4a2abe2aa2dcaf35c36d6513e1e2a44c Mon Sep 17 00:00:00 2001 From: Don Date: Thu, 26 Apr 2018 15:05:22 -0700 Subject: [PATCH 3/3] fix: add gitUrl to config --- ci-services/drone.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ci-services/drone.js b/ci-services/drone.js index 54a93c8d..d01f3c13 100644 --- a/ci-services/drone.js +++ b/ci-services/drone.js @@ -21,5 +21,7 @@ module.exports = { // 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') + uploadBuild: env.DRONE_JOB_NUMBER.endsWith('1'), + // The git url + gitUrl: env.DRONE_REMOTE_URL }