greenkeeperio / greenkeeper-lockfile

:lock: Your lockfile, up to date, all the time
https://greenkeeper.io
183 stars 73 forks source link

feat: add team city support #131

Closed tagoro9 closed 6 years ago

tagoro9 commented 6 years ago

This PR adds support for Team City.

Team City has all the build related information in certain configuration parameters, but in order to make them available to greenkeeper-lockfile, they need to be manually mapped to environment variables in the build configuration.

This PR assumes that these two variables are available to the script:

The GH_TOKEN environment variable also needs to be defined, but that needs to happen independently of the CI server.

In order to detect if builds are coming from a PR or not, we can check the name of the branch. If it ends with /merge or /head, it means it is a pull request according to this post.

In order to set the firstPush and correctBuild flags correctly I copied the logic from the Codeship implementation. Unlike Codeship, Team City does not provide any parameter to access the commit message, so I added a function in gitHelpers to do that.

Edit: I just realized that https://github.com/greenkeeperio/greenkeeper-lockfile/pull/106 is also trying to add support to Team City. I hadn't seen it until I created the PR. There are some differences between both PRs. I'm happy to close this PR if the other path is preferred. Sorry for the noise.

greenkeeperio-bot commented 6 years ago

:tada: This PR is included in version 1.15.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: