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

hack: touch up scripts #953

Closed
wants to merge 4 commits into from
Closed

Conversation

thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Apr 20, 2019

Created on top of #942 (first commit is from that PR)

See individual commits for details

@thaJeztah
Copy link
Member Author

ping @tianon @albers PTAL 🤗

hack/binaries Outdated
case "$(echo "${TARGETPLATFORM}" | cut -d"/" -f1)" in
"darwin")
case "${TARGETPLATFORM}" in
darwin/*)
Copy link
Member

Choose a reason for hiding this comment

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

TARGETPLATFORM can be just darwin as well. Eg. docker build --platform darwin works fine and missing sections are added automatically.

Copy link
Member Author

Choose a reason for hiding this comment

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

oh! right 🤦‍♂️ should've seen that, I can fix that by changing the case to;

case "${TARGETPLATFORM%%/*}" in

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed 👍

@thaJeztah thaJeztah force-pushed the hack_script_touch_ups branch 4 times, most recently from b03da99 to b10bfb2 Compare April 23, 2019 15:13
@thaJeztah
Copy link
Member Author

rebased to get rid of the commit from #942

Copy link
Member

@albers albers left a comment

Choose a reason for hiding this comment

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

Well, I've never seen these scripts before, so my review might not be too helpful.
I found minor issues, though.

hack/images Outdated
docker build $@ --platform=$PLATFORMS -t $REPO:$TAG .
docker build $@ --platform=$PLATFORMS -t $REPO:$TAG-rootless --target rootless .
docker build $@ --"platform=${PLATFORMS}" -t "${REPO}:${TAG}" .
docker build $@ --"platform=${PLATFORMS}" -t "${REPO}:${TAG}-rootless" --target rootless .
Copy link
Member

Choose a reason for hiding this comment

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

Placement of quotes looks strange to me. I suggest to either quote the whole thing ("--platform=${PLATFORMS}") or just the part that might contain whitespace (--platform="${PLATFORMS}").

Copy link
Member Author

Choose a reason for hiding this comment

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

oh, good catch; I think this might've been a wrong find/replace on my side

hack/images Outdated
--opt platform=$PLATFORMS \
--output type=image,name=$REPO:$TAG$tagLatest,$pushFlag
--opt "platform=${PLATFORMS}" \
--output "type=image,name=${REPO}:${TAG}${TAG}Latest,${PUSH}Flag"
Copy link
Member

Choose a reason for hiding this comment

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

I think this is wrong.

Suggested change
--output "type=image,name=${REPO}:${TAG}${TAG}Latest,${PUSH}Flag"
--output "type=image,name=${REPO}:${TAG}${TAG}Latest,${pushFlag}"

Copy link
Member Author

Choose a reason for hiding this comment

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

arf; you're right; looks like I've been sleeping on my latest changes 😓

hack/images Outdated
--opt platform=$PLATFORMS \
--output type=image,name=$REPO:$TAG-rootless$tagLatestRootless,$pushFlag
--opt "platform=${PLATFORMS}" \
--output "type=image,name=${REPO}:${TAG}-rootless${TAG}LatestRootless,${PUSH}Flag"
Copy link
Member

Choose a reason for hiding this comment

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

same here.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah
Copy link
Member Author

updated 🤗

docker build --iidfile $iidfile --build-arg BUILDKITD_TAGS="${BUILDKITD_TAGS}" --target buildkit-binaries -f ./hack/dockerfiles/test.Dockerfile --force-rm .
;;
esac
case "${TARGETPLATFORM%%/*}" in
Copy link
Collaborator

Choose a reason for hiding this comment

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

i find this less readable than cut

@AkihiroSuda
Copy link
Member

needs rebase

@AkihiroSuda
Copy link
Member

ping @thaJeztah

@AkihiroSuda
Copy link
Member

Is this still on plan?

@tonistiigi
Copy link
Member

Too many conflicts.

Probably can skip the nice to have or opinionated things like full whitespace conversion if you still wish to update this for easier review.

@tonistiigi tonistiigi closed this Feb 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants