Skip to content
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

feat: add team city support #131

Merged
merged 1 commit into from
Apr 4, 2018
Merged

feat: add team city support #131

merged 1 commit into from
Apr 4, 2018

Conversation

tagoro9
Copy link
Contributor

@tagoro9 tagoro9 commented Mar 20, 2018

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 the vcsroot.<vcsrootid>.url parameter
  • VCS_ROOT_BRANCH which is mapped to the teamcity.build.branch parameter

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 #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.

Copy link
Contributor

@janl janl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, thanks a lot!

@janl janl merged commit 6a1068a into greenkeeperio:master Apr 4, 2018
@greenkeeperio-bot
Copy link
Member

🎉 This PR is included in version 1.15.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@tagoro9 tagoro9 deleted the teamcity branch May 8, 2018 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants