Reputation: 79
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
Reputation: 3477
Clone the repo using ssh key, by uploading the key
Setup VCS checkout to clone on Agent machine
Add SSH agent build feature
Add a command step that sets the VCS
git config --system user.email "[email protected]"
git config --system user.name "TeamCity Server"
references:
Upvotes: 0
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
Reputation: 1681
You might want to check this answer. CUrl + GitHub JSON API is the best bet here
Upvotes: -1