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

Add branchName as argument to specify what branch to build in TeamCity. #23

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Place the latest released version under the `plugins` dir.
- `username` - Used to override the TeamCity username - optional
- `password` - Used to override the TeamCity password - optional
- `buildConfID` - The buildConfID for the TeamCity build job, usually found in the settings screen for the build job.
- `branchName` - The branchName for the TeamCity build job if a non-default branch is used - optional
- `buildProperties` - A set of key value pairs to submit to configure the build job
- `buildNumber` - Output field where the build number will be set on successful completion

Expand Down
1 change: 1 addition & 0 deletions src/main/resources/synthetic.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<type type="teamcity.Build" extends="teamcity.Task">
<property name="scriptLocation" default="teamcity/Build.py" hidden="true"/>
<property name="buildID" category="input" label="Build Conf ID" required="true"/>
<property name="branchName" category="input" label="Branch Name" required="false"/>
<property name="buildProperties" category="input" kind="map_string_string" label="Build Properties" required="false" />
<property name="pollInterval" category="input" kind="integer" default="5"/>

Expand Down
1 change: 1 addition & 0 deletions src/main/resources/teamcity/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ def teamcity_assigntopool(self, variables):
def teamcity_build(self, variables):
request_url = self.host + "/app/rest/buildQueue"
content = {'buildType': {'id': variables['buildID']}}
content['branchName'] = variables['branchName']
if len(variables['buildProperties']) > 0:
content['properties'] = {"property": []}
for prop in variables['buildProperties'].keys():
Expand Down