uniasfen.blogg.se

Teamcity rest api
Teamcity rest api




  1. #TEAMCITY REST API INSTALL#
  2. #TEAMCITY REST API FULL#

# Otherwise the beginning strings are cut off.

#TEAMCITY REST API FULL#

# If there are no common elements, return the full name of the project. Match = sequenceMatcher.get_matching_blocks() SequenceMatcher = SequenceMatcher(None, topSplit, destSplit) Return the number of starting array elements that match in both.ĭestSplit = destProjectName.split(' :: ') Return srcResult.strip(), depResult.strip()ĭef trimProjectName(topProjectName, destProjectName): SrcResult = trimProjectName(topProjectName, srcProjectName).replace(" :: ", ".")ĭepResult = trimProjectName(topProjectName, depProjectName).replace(" :: ", ".") This is combined with the name in brackets. # If the project names start the same, cut off the common substring to be OutputGraph.add_edge(nodeName, depNodeName, color=edgeColor)Įlif all(attrs != edgeColor for attrs in outputGraph.values()):ĭef getNodeNames(topNode, srcNode, depNode): If not outputGraph.has_edge(nodeName, depNodeName): # We will add another edge if a different dependency exists, or if there is no edge NodeName, depNodeName = getNodeNames(topNode, source, dependency) Result.append(dependency)ĭef addDependencyToGraph(outputGraph, topNode, source, dependency, dependencyName): 'artifact-dependencies' : 'artifact-dependency'ĭependencyDict = nodeJsonįor dependency in dependencyDict]: 'snapshot-dependencies' : 'snapshot-dependency', GenerateGraph_impl(outputGraph, topNode, getProjectJson(dep))ĭef getDependencies(nodeJson, dependencyName): Url = ")".format(projectId, status))ĭef generateGraph_impl(outputGraph, topNode, node):ĪddDependenciesToGraph(outputGraph, topNode, node, 'artifact-dependencies')ĪddDependenciesToGraph(outputGraph, topNode, node, 'snapshot-dependencies')ĭef addDependenciesToGraph(outputGraph, topNode, node, dependencyName):įor dep in getDependencies(node, dependencyName):ĪddDependencyToGraph(outputGraph, topNode, node, dep, dependencyName) In code, it is utilized like so: def getProjectJson(projectId): guestAuth/ is used to simplify authentication. This will give us the properties of a project. We are only concerned with one endpoint here: /guestAuth/app/rest/buildTypes/id:/

#TEAMCITY REST API INSTALL#

The required libraries are requests, pydotplus, and networkx: pip install requests pydotplus networkxįor all network requests, such as that to the TeamCity API and Google Charts, the requests module is used. Render the graph utilizing the Dot language and Graphviz.For each of that project’s dependencies, recursively traverse them and construct a graph.This ID can be found in the settings of the TeamCity configuration in question./tcdependencygraph.py My_Project_ID

teamcity rest api

The script is invoked by passing the TeamCity ID whose graph is requested. In many cases at Accusoft, we are tasked with commanding large TeamCity build chains, sometimes interacting with dozens of build configurations: build tests, run them, and build all their dependencies! Being able to visualize these relationships is a benefit to my team that allows them to discuss these relationships and discover potential issues, so I created a Python 2.7 script to do so.






Teamcity rest api