Skip to content

Bamboo: Added 2 methods to bamboo for deployments #1173

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

Merged
Merged
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
22 changes: 22 additions & 0 deletions atlassian/bamboo.py
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,28 @@ def deployment_dashboard(self, project_id=None):
resource = "deploy/dashboard/{}".format(project_id) if project_id else "deploy/dashboard"
return self.get(self.resource_url(resource))

def get_deployment_projects_for_plan(self, plan_key):
"""
Returns deployment projects associated with a build plan.
:param plan_key: The key of the plan.
"""
resource = "deploy/project/forPlan"
params = {"planKey": plan_key}
for deployment_project in self.get(self.resource_url(resource), params=params):
yield deployment_project

def trigger_deployment_for_version_on_environment(self, version_id, environment_id):
"""
Triggers a deployment for a release version on the given environment.
Example: trigger_deployment_for_version_on_environment(version_id='3702785', environment_id='3637249')
:param version_id: str or int id of the release version.
:param environment_id: str or int id of the deployment environment.
:return:
"""
resource = "queue/deployment"
params = {"versionId": version_id, "environmentId": environment_id}
return self.post(self.resource_url(resource), params=params)

""" Users & Groups """

def get_users_in_global_permissions(self, start=0, limit=25):
Expand Down