File size: 972 Bytes
56d74b6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | # coding=utf-8
import os
from atlassian import Bamboo
BAMBOO_URL = os.environ.get("BAMBOO_URL", "http://localhost:8085")
ATLASSIAN_USER = os.environ.get("ATLASSIAN_USER", "admin")
ATLASSIAN_PASSWORD = os.environ.get("ATLASSIAN_PASSWORD", "admin")
bamboo = Bamboo(url=BAMBOO_URL, username=ATLASSIAN_USER, password=ATLASSIAN_PASSWORD)
# Methods in plural (projects, plans, results...) return a generator that iterates through
# all results without the need of dealing need with pagination
# for project in bamboo.projects():
# print(project)
for branch in bamboo.plan_branches("PROJ-SP2"):
print(branch)
# for result in bamboo.latest_results():
# print(result)
# for result in bamboo.plan_results(project_key='FOO', plan_key='BAR'):
# print(result)
# for report in bamboo.reports():
# print(report)
# Methods in singular (project, plan, result...) return a single dictionary
print(bamboo.project("FOO"))
print(bamboo.build_result("FOO-BAR-1"))
|