Skip to content

Commit

Permalink
Get greenkeeper-lockfile working for Jenkins pipelines.
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-codaio authored and Realtin committed May 8, 2018
1 parent 2c33fa9 commit d150d65
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions ci-services/jenkins.js
Expand Up @@ -5,10 +5,15 @@ const env = process.env
const _ = require('lodash')
const gitHelpers = require('../lib/git-helpers')

// Jenkins reports the branch name and Git URL in a couple of different places depending on use of the new
// pipeline vs. older job types.
const branchName = env.CHANGE_BRANCH || env.GIT_BRANCH
const gitUrl = env.CHANGE_URL || env.GIT_URL

module.exports = {
gitUrl: env.GIT_URL,
branchName: _.drop(_.split(env.GIT_BRANCH, '/')).join('/'),
gitUrl,
branchName,
firstPush: env.BUILD_NUMBER === '1' || gitHelpers.getNumberOfCommitsOnBranch(env.GIT_BRANCH) === 1,
correctBuild: true, // assuming pull requests are not build
uploadBuild: true // assuming 1 build per branch
correctBuild: true, // assuming this is always the correct build to update the lockfile
uploadBuild: true // assuming 1 build per branch/PR
}

0 comments on commit d150d65

Please sign in to comment.