Skip to content

Commit

Permalink
build: add print-image-list makefile target
Browse files Browse the repository at this point in the history
It will be useful to get the list of image names when pushing
containers. This can be used for any scripts that you may need to
write.
  • Loading branch information
webern committed Jun 16, 2022
1 parent 8a417bd commit 43dc806
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ PUSH_IMAGES = $(addprefix push-, $(IMAGES))

.PHONY: build sdk-openssl example-test-agent example-resource-agent \
images fetch integ-test show-variables cargo-deny tools $(IMAGES) \
tag-images $(TAG_IMAGES) push-images $(PUSH_IMAGES)
tag-images $(TAG_IMAGES) push-images $(PUSH_IMAGES) print-image-names

export DOCKER_BUILDKIT=1
export CARGO_HOME = $(TOP)/.cargo
Expand All @@ -44,6 +44,20 @@ fetch:

images: fetch $(IMAGES)

# This target prints the image names. It may be useful to write loops over the names of the containers. For example, we
# might want to check to make sure a repository exists for each image (i.e. maybe a new container has been added to the
# list since we last pushed, so maybe we need to create a new repository).
#
# Example:
# declare -a arr=($(make print-image-names))
# for image_name in "${arr[@]}"
# do
# echo "do something with $image_name"
# done
print-image-names:
$(info $(IMAGES))
@echo > /dev/null

# Builds, Lints and Tests the Rust workspace
build: fetch
cargo fmt -- --check
Expand Down

0 comments on commit 43dc806

Please sign in to comment.