Skip to content

Commit

Permalink
fix(dev): Minor fixes to special cases in build_release
Browse files Browse the repository at this point in the history
Fixed --nobuild option
Fixed optional directories not available.
  • Loading branch information
Eric Wiseblatt committed Mar 9, 2017
1 parent f11330b commit f5f4b86
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
11 changes: 9 additions & 2 deletions dev/build_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ def determine_modules_with_debians(gradle_root):

def determine_package_version(gradle_root):
root = determine_modules_with_debians(gradle_root)
if not root:
return None

with open(os.path.join(root[0], 'build', 'debian', 'control')) as f:
content = f.read()
Expand Down Expand Up @@ -495,6 +497,9 @@ def start_copy_debian_target(self, name):
pids = []
gradle_root = self.determine_gradle_root(name)
version = determine_package_version(gradle_root)
if version is None:
return []

for root in determine_modules_with_debians(gradle_root):
deb_dir = '{root}/build/distributions'.format(root=root)

Expand Down Expand Up @@ -567,11 +572,12 @@ def build_container_images(self):
def build_packages(self):
"""Build all the Spinnaker packages."""
all_subsystems = []
all_subsystems.extend(SUBSYSTEM_LIST)
all_subsystems.extend(ADDITIONAL_SUBSYSTEMS)

if self.__options.build:
# Build in parallel using half available cores
# to keep load in check.
all_subsystems.extend(SUBSYSTEM_LIST)
all_subsystems.extend(ADDITIONAL_SUBSYSTEMS)
weighted_processes = self.__options.cpu_ratio * multiprocessing.cpu_count()
pool = multiprocessing.pool.ThreadPool(
processes=int(max(1, weighted_processes)))
Expand All @@ -597,6 +603,7 @@ def build_packages(self):
def __do_copy(self, subsys):
print 'Starting to copy {0}...'.format(subsys)
pids = self.start_copy_debian_target(subsys)

for p in pids:
p.check_wait()
print 'Finished copying {0}.'.format(subsys)
Expand Down
3 changes: 3 additions & 0 deletions dev/refresh_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,9 @@ def pull_from_upstream_if_master(self, repository):
repository_dir = get_repository_dir(name)
if not os.path.exists(repository_dir):
self.pull_from_origin(repository)
if not os.path.exists(repository_dir):
return

branch = self.get_local_branch_name(name)
if branch != 'master':
sys.stderr.write('Skipping {name} because it is in branch={branch}.\n'
Expand Down

0 comments on commit f5f4b86

Please sign in to comment.