Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 4 additions & 1 deletion .github/workflows/build_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ jobs:
docker images
- name: Build Docker Images
run: |
./build_images.py --branch '${{ github.event.inputs.branch }}' --repo '${{ github.event.inputs.repo }}' --root-image-name '${{ github.event.inputs.root_image_name }}'
./build_images.py \
--branch '${{ github.event.inputs.branch }}' \
--repo '${{ github.event.inputs.repo }}' \
--root-image-name '${{ github.event.inputs.root_image_name }}'
- name: Show Building Graph
run: |
cat graph.yaml
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_images_regular.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Build Docker Images Regularly
run: |
df -lh
./build_images.py --branch "" --repo "" --root-image-name ""
./build_images.py --branch "" --repo "" --root-image-name "" --remove-images
cat graph.yaml
df -lh
- name: Set Environment Variable
Expand Down
8 changes: 7 additions & 1 deletion build_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ def parse_args(args=None, namespace=None) -> Namespace:
required=True,
help="The name of the base/root Docker image in dependency resolving.",
)
parser.add_argument(
"--remove-images",
dest="remove_images",
action="store_true",
help="Remove a Docker image when it's not needed (for building other images).",
)
return parser.parse_args(args=args, namespace=namespace)


Expand All @@ -73,7 +79,7 @@ def main() -> None:
args.branch = "dev"
branch_urls = {args.branch: {args.repo: args.root_image_name}}
builder = DockerImageBuilder(branch_urls)
builder.build_images(remove=True)
builder.build_images(remove=args.remove_images)
builder.save_graph()


Expand Down
Loading