Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
VCS_ROOT_URL
which is mapped to thevcsroot.<vcsrootid>.url
parameterVCS_ROOT_BRANCH
which is mapped to theteamcity.build.branch
parameterThe
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
andcorrectBuild
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 ingitHelpers
to do that.Edit: I just realized that #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.