Skip to content

Commit

Permalink
fix(publish_bom): Update 'hal' commands and repo paths. (#1588)
Browse files Browse the repository at this point in the history
  • Loading branch information
jtk54 committed Apr 21, 2017
1 parent dc7588a commit 422eacb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
4 changes: 4 additions & 0 deletions dev/generate_bom.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ def __init__(self, options):
self.__alias = options.bom_alias
super(BomGenerator, self).__init__(options)

@property
def base_dir(self):
return self.__base_dir

@classmethod
def init_argument_parser(cls, parser):
"""Initialize command-line arguments."""
Expand Down
15 changes: 8 additions & 7 deletions dev/publish_bom.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ def __init__(self, options):
def unpack_bom(self):
"""Load the release candidate BOM into memory.
"""
bom_yaml_string = run_quick('hal versions bom {0} --color false'
bom_yaml_string = run_quick('hal version bom {0} --color false --quiet'
.format(self.__rc_version), echo=False).stdout.strip()
print bom_yaml_string
print 'bom yaml string pulled by hal: \n\n{0}\n\n'.format(bom_yaml_string)
self.__bom_dict = yaml.load(bom_yaml_string)
print self.__bom_dict

Expand Down Expand Up @@ -120,11 +120,12 @@ def push_branch_and_tags(self):
# https://github.com/nebula-plugins/nebula-release-plugin#extension-provided
stable_branch = '.'.join([major, minor, 'X'])
for comp in COMPONENTS:
comp_path = os.path.join(self.base_dir, comp)
if self.__patch_release:
check_run_quick('git -C {0} checkout {1}'.format(comp, stable_branch))
check_run_quick('git -C {0} checkout {1}'.format(comp_path, stable_branch))
else:
# Create new release branch.
check_run_quick('git -C {0} checkout -b {1}'.format(comp, stable_branch))
check_run_quick('git -C {0} checkout -b {1}'.format(comp_path, stable_branch))

version_tag_build = ''
if comp == 'spinnaker-monitoring':
Expand All @@ -137,9 +138,9 @@ def push_branch_and_tags(self):
repo_to_push = ('git@github.com:{owner}/{comp}.git'
.format(owner=self.__github_publisher, comp=comp))
check_run_quick('git -C {comp} remote add release {url}'
.format(comp=comp, url=repo_to_push))
.format(comp=comp_path, url=repo_to_push))
check_run_quick('git -C {comp} push release {branch}'
.format(comp=comp, branch=stable_branch))
.format(comp=comp_path, branch=stable_branch))

repo = self.__github.get_repo('{owner}/{comp}'.format(owner=self.__github_publisher, comp=comp))
paginated_tags = repo.get_tags()
Expand All @@ -149,7 +150,7 @@ def push_branch_and_tags(self):
print ('pushing version tag {tag} to {owner}/{comp}'
.format(tag=version_tag, owner=self.__github_publisher, comp=comp))
check_run_quick('git -C {comp} push release {tag}'
.format(comp=comp, tag=version_tag))
.format(comp=comp_path, tag=version_tag))

@classmethod
def main(cls):
Expand Down

0 comments on commit 422eacb

Please sign in to comment.