How do I trigger a build for a specific git commit via Teamcity REST API?
Hello!
I know how to trigger a build for the latest change in the cvs.
But how do i specify which commit I want to build?
Or, which branch I want to build?
<build>
<buildType id="Marc_Build"/>
<properties>
<property name="deploy_name" value="somecustomparam"/>
<changes>
<change version="s5hab2ahsjh2..."
</changes>
</properties>
</build>
Please sign in to leave a comment.
Hi Anders,
You can trigger a build for a specific change, by adding:
Also you can get change id by revision:
To specify branch use
branchName="" parameter:http://localhost:8111/httpAuth/app/rest/changes/version:60b45e9501e24387d50a955d81261e18b047cfd5This lets me check the changes for the commit, but is there a rest endpoint to kick off a build for that sha?
For example, you can do something like
http://#{hostname}/httpAuth/action.html?add2Queue={buildname}
but is there something along the lines of
http://#{hostname}/httpAuth/action.html?project={projectname}&commit_sha=60b45e9501e24387d50a955d81261e18b047cfd5?
Hi Jesse,
It is not possible to trigger build for commit, while you can trigger build on specific change:
where build.xml is: