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

Add "SharedTags" support to "diff-pr.sh" #3059

Merged
merged 1 commit into from
Jul 5, 2017
Merged
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
18 changes: 18 additions & 0 deletions diff-pr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,22 @@ archesListTemplate='
{{- end -}}
{{- end -}}
'
# ... and SharedTags
sharedTagsListTemplate='
{{- range $group := .Manifest.GetSharedTagGroups -}}
{{- range $tag := $group.SharedTags -}}
{{- join ":" $.RepoName $tag -}}
{{- " -- " -}}
{{- range $i, $e := $group.Entries -}}
{{- if gt $i 0 -}}
{{- ", " -}}
{{- end -}}
{{- join ":" $.RepoName ($e.Tags | last) -}}
{{- end -}}
{{- "\n" -}}
{{- end -}}
{{- end -}}
'

# TODO something less hacky than "git archive" hackery, like a "bashbrew archive" or "bashbrew context" or something
template='
Expand Down Expand Up @@ -184,6 +200,7 @@ git -C temp init --quiet

bashbrew list "${images[@]}" | sort -V > temp/_bashbrew-list || :
bashbrew cat --format "$archesListTemplate" "${images[@]}" | sort -V > temp/_bashbrew-arches || :
bashbrew cat --format "$sharedTagsListTemplate" "${images[@]}" | grep -vE '^$' | sort -V > temp/_bashbrew-shared-tags || :
for image in "${images[@]}"; do
if script="$(bashbrew cat -f "$template" "$image")"; then
mkdir tar
Expand All @@ -200,6 +217,7 @@ git -C oi checkout --quiet pull
git -C temp rm --quiet -rf . || :
bashbrew list "${images[@]}" | sort -V > temp/_bashbrew-list || :
bashbrew cat --format "$archesListTemplate" "${images[@]}" | sort -V > temp/_bashbrew-arches || :
bashbrew cat --format "$sharedTagsListTemplate" "${images[@]}" | grep -vE '^$' | sort -V > temp/_bashbrew-shared-tags || :
script="$(bashbrew cat -f "$template" "${images[@]}")"
mkdir tar
( eval "$script" | tar -xiC tar )
Expand Down