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

Minimal changes for changing global to local #516

Closed
Closed
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
9 changes: 3 additions & 6 deletions build_latest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -215,16 +215,13 @@ function build_image() {
repo=$1; shift;
build=$1; shift;
btype=$1; shift;
local tag=$1; shift;
karianna marked this conversation as resolved.
Show resolved Hide resolved

local local_tags=("$@") # copy arguments to local array
for i in "${!local_tags[@]}"
do
tags="${tags} -t ${repo}:${local_tags[$i]}"
done
tags=" -t ${repo}:${tag}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Is the tags var even referenced anymore?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah at the time when we call check_build_needed here I do accept that with current changes we can pass expanded_tags instead of tags but the check_build_needed expects string to have format -t repo:tag but expanded_tags has a format of -t repo:tag if we update the check_build_needed not to consider space when formating adopt_image_tag we can completely remove the tags var here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your call - I think either leave a comment explaining why they're different or make that change as you suggest.


auto_space_line=" "
image_name="${repo}:${tag}"
printf -v expanded_tags "%s ${repo}:%s " "-t" "${local_tags[@]}" # concatenate to single string : -t repo:tag -t repo:tag2
printf -v expanded_tags "%s ${repo}:%s " "-t" "${tag}" # concatenate to single string : -t repo:tag -t repo:tag2
expanded_tags=${expanded_tags%?} # remove trailing space
dockerfile="Dockerfile.${vm}.${build}.${btype}"
# Check if we need to build this image.
Expand Down