Skip to content

Commit a2620bf

Browse files
Dmitriy DiachkovDmitriy Diachkov
authored andcommitted
Add a new Bamboo example
1 parent 4834981 commit a2620bf

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

examples/bamboo-add-plan-branch.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
from atlassian import Bamboo
2+
import argparse
3+
4+
bamboo = Bamboo(url="https://", username="", password="")
5+
6+
7+
def create_plan_branch(plan, vcs_branch):
8+
bamboo_branch = vcs_branch.replace("/", "-")
9+
return bamboo.create_branch(
10+
plan, bamboo_branch, vcs_branch=vcs_branch, enabled=True
11+
)
12+
13+
14+
def main():
15+
parser = argparse.ArgumentParser()
16+
parser.add_argument("--plan")
17+
parser.add_argument("--vcs_branch")
18+
args = parser.parse_args()
19+
20+
branch = create_plan_branch(plan=args.plan, vcs_branch=args.vcs_branch)
21+
print(branch.get("key") or branch)
22+
23+
24+
if __name__ == "__main__":
25+
main()

0 commit comments

Comments
 (0)