Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove non-public images from the git-sha-based target determination #525

Merged
merged 4 commits into from
Apr 19, 2023
Merged
Changes from 2 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
18 changes: 13 additions & 5 deletions scripts/docker/build_docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,11 +387,19 @@ def build_and_push(self):
if self.project_arguments.base_git_commit is not None:
changed_project_files = self.changed_project_files
print(f"changed_project_files: {changed_project_files}", file=sys.stderr)
self.project_arguments.targets = [
target for target, image_dependencies in self.dependencies.items()
if image_dependencies.has_change(changed_project_files)
]
print(f"targets = {self.project_arguments.targets}")
self.project_arguments.targets = []
for target, image_dependencies in self.dependencies.items():
if image_dependencies.has_change(changed_project_files):
if target not in self.non_public_images:
self.project_arguments.targets.append(target)
else:
print_colored(
f"Skipping building the Docker image `{target}` since it cannot be hosted publicly. "
f"This image needs to be rebuilt, please consider building using the "
f"`--targets` tag and hosting it in a non-public registry.",
Colors.YELLOW
)
print_colored(f"targets = {self.project_arguments.targets}", Colors.GREEN)
elif "all" in self.project_arguments.targets:
self.project_arguments.targets = ProjectBuilder.images_built_by_all
# get targets + their dependencies in order (so that builds succeed)
Expand Down