david
david

Reputation: 79

Is it possible to push changes to a VCS root in Team City?

As the title says,

I am currently running a build in Team City where the VCS root is pointing to a github repo. I would like to run this build where it also updates property files within my github repo. I have only found ways to publish artifacts to Team City, but has anyone been able to commit and push from Team City to their VCS root?

Thank you very much in advance.

Upvotes: 5

Views: 3844

Answers (3)

Mukundhan
Mukundhan

Reputation: 3477

  1. Clone the repo using ssh key, by uploading the key

  2. Setup VCS checkout to clone on Agent machine

  3. Add SSH agent build feature

    https://www.jetbrains.com/help/teamcity/ssh-agent.html

  4. Add a command step that sets the VCS

   git config --system user.email "[email protected]"
   git config --system user.name "TeamCity Server"
  1. Commit and push

references:

Upvotes: 0

Etienne Prothon
Etienne Prothon

Reputation: 1082

If you choose VCS checkout mode: Automatically on agent (if supported by VCS roots) in the Version Control Settings of your project you will be able to run git command inside your build.

So in the last build step you can just add a git push origin your_branch and TeamCity will push the changes inside your VCS root.

Upvotes: 6

Oleg Rybak
Oleg Rybak

Reputation: 1681

You might want to check this answer. CUrl + GitHub JSON API is the best bet here

Upvotes: -1

Related Questions