Skip to content
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
14 changes: 9 additions & 5 deletions common/Scripts/publish_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def __init__(self, base: Optional[str], head: str, path: str, title: str,
self.render = render
self.wait = wait
self.git = Git(path)
self.builds = Builds().all

def run(self) -> bool:
commits = self.git.commit_refs(self.base, self.head)
Expand All @@ -103,7 +104,7 @@ def run(self) -> bool:
self._render(commit)

if self._skip_commit(commit):
print(f'Skipping commit: {self.git.commit_summary(commit)}')
print(f'Skipping commit: {self._commit_str(commit)}')
continue

comment = f'BUILD {i+1}/{len(commits)}'
Expand All @@ -116,7 +117,7 @@ def run(self) -> bool:
if not found:
id = self._push_build(build)
else:
print(f'Skipping build: {build}')
print(f'Skipping build: {self._commit_str(build.ref)}')

if self.wait:
self._wait_for_build(id)
Expand Down Expand Up @@ -169,9 +170,9 @@ def _git_push(self) -> None:
self.git.run('push')

def _push_build(self, build: Build) -> int:
print(f'Pushing build: {build}')
print(f'Pushing build: {self._commit_str(build.ref)}')
if self.noop:
return Builds().all[-1].id
return self.builds[-1].id

output = self._run('ssh', 'build-controller@build.getsol.us', 'build',
build.source, build.tag, build.path, build.ref,
Expand All @@ -181,7 +182,7 @@ def _push_build(self, build: Build) -> int:

def _build_exists(self, build: Build) -> Tuple[bool, int]:
try:
found = next(b for b in Builds().all
found = next(b for b in self.builds
if b.tag == build.tag and b.status != 'FAILED')
return True, found.id
except StopIteration:
Expand Down Expand Up @@ -225,6 +226,9 @@ def _render(self, commit: str) -> None:
f.close()
self._run('xdg-open', f.name)

def _commit_str(self, ref: str) -> str:
return f'{self.git.commit_summary(ref)} ({ref[:10]})'

@staticmethod
def _run(*args: str) -> str:
res = subprocess.run(args, text=True, capture_output=True)
Expand Down
Loading