Changeset View
Changeset View
Standalone View
Standalone View
contrib/buildbot/server.py
Show First 20 Lines • Show All 249 Lines • ▼ Show 20 Lines | def build_diff(): | ||||
argument, | argument, | ||||
request.args | request.args | ||||
) | ) | ||||
) | ) | ||||
return value | return value | ||||
staging_ref = get_mandatory_argument('stagingRef') | staging_ref = get_mandatory_argument('stagingRef') | ||||
target_phid = get_mandatory_argument('targetPHID') | target_phid = get_mandatory_argument('targetPHID') | ||||
revision_id = get_mandatory_argument('revisionId') | |||||
# Get the configuration from master | # Get the configuration from master | ||||
config = yaml.safe_load(phab.get_file_content_from_master( | config = yaml.safe_load(phab.get_file_content_from_master( | ||||
"contrib/teamcity/build-configurations.yml")) | "contrib/teamcity/build-configurations.yml")) | ||||
# Get a list of the builds that should run on diffs | # Get a list of the builds that should run on diffs | ||||
builds = [ | builds = [ | ||||
k for k, | k for k, | ||||
v in config.get( | v in config.get( | ||||
'builds', | 'builds', | ||||
{}).items() if v.get( | {}).items() if v.get( | ||||
'runOnDiff', | 'runOnDiff', | ||||
False)] | False)] | ||||
if target_phid in create_server.db['diff_targets']: | if target_phid in create_server.db['diff_targets']: | ||||
build_target = create_server.db['diff_targets'][target_phid] | build_target = create_server.db['diff_targets'][target_phid] | ||||
else: | else: | ||||
build_target = BuildTarget(target_phid) | build_target = BuildTarget(target_phid) | ||||
for build_name in builds: | for build_name in builds: | ||||
properties = [{ | properties = [{ | ||||
'name': 'env.ABC_BUILD_NAME', | 'name': 'env.ABC_BUILD_NAME', | ||||
'value': build_name, | 'value': build_name, | ||||
}, { | |||||
'name': 'env.ABC_REVISION', | |||||
'value': revision_id, | |||||
}] | }] | ||||
build_id = tc.trigger_build( | build_id = tc.trigger_build( | ||||
'BitcoinABC_BitcoinAbcStaging', | 'BitcoinABC_BitcoinAbcStaging', | ||||
staging_ref, | staging_ref, | ||||
target_phid, | target_phid, | ||||
properties)['id'] | properties)['id'] | ||||
build_target.queue_build(build_id, build_name) | build_target.queue_build(build_id, build_name) | ||||
▲ Show 20 Lines • Show All 720 Lines • Show Last 20 Lines |