Skip to content

Commit

Permalink
Merge branch 'release/0.17.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
lasote committed May 29, 2018
2 parents dab61af + 4382fba commit cbf3e2c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ htmlcov/
.coverage
.coverage.*
.cache
.noseids
nosetests.xml
coverage.xml
*,cover
Expand Down
2 changes: 1 addition & 1 deletion cpt/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@

__version__ = '0.17.3'
__version__ = '0.17.4'
7 changes: 7 additions & 0 deletions cpt/ci_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,13 @@ def __init__(self, printer):
super(BambooManager, self).__init__(printer)
self.printer.print_message("CI detected: Bamboo")

for var in list(os.environ.keys()):
result = re.match('\Abamboo\.(.*)', var)
if result != None:
self.printer.print_message("de-bambooized env var : %s " % result.group(1))
os.environ[result.group(1)] = os.environ[var]


def get_branch(self):
return os.getenv("bamboo_planRepository_branch", None)

Expand Down
11 changes: 11 additions & 0 deletions cpt/test/unit/ci_manager_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,14 @@ def test_build_policy(self):
}):
manager = CIManager(self.printer)
self.assertRaises(Exception, manager.get_commit_build_policy)

def test_bamboo_env_vars(self):
self.assertIsNone(os.getenv('CONAN_LOGIN_USERNAME'))

with tools.environment_append({"bamboo_buildNumber": "xx",
"bamboo_planRepository_branch": "mybranch",
"bamboo.CONAN_LOGIN_USERNAME": "bamboo"}):
manager = CIManager(self.printer)
self.assertEquals(manager.get_branch(), "mybranch") # checks that manager is Bamboo

self.assertEquals(os.getenv('CONAN_LOGIN_USERNAME'), "bamboo")

0 comments on commit cbf3e2c

Please sign in to comment.