This repository has been archived by the owner on Jan 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #65 from infosiftr/suite-tags
Add arches supported by upstream percona (i386), add suite tags for `jessie` (so we can move to `stretch`)
- Loading branch information
Showing
7 changed files
with
342 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/usr/bin/env bash | ||
|
||
hasBashbrewArch() { | ||
local version="$1"; shift | ||
local bashbrewArch="$1"; shift | ||
local arches="$(grep 'bashbrew-architectures:' "$version/Dockerfile" | cut -d':' -f2)" | ||
[[ " $arches " == *" $bashbrewArch "* ]] | ||
} | ||
|
||
_generateParentRepoToArches() { | ||
local repo="$1"; shift | ||
local officialImagesUrl='https://github.com/docker-library/official-images/raw/master/library/' | ||
|
||
eval "declare -g -A parentRepoToArches=( $( | ||
find -name 'Dockerfile' -exec awk ' | ||
toupper($1) == "FROM" && $2 !~ /^('"$repo"'|scratch|microsoft\/[^:]+)(:|$)/ { | ||
print "'"$officialImagesUrl"'" $2 | ||
} | ||
' '{}' + \ | ||
| sort -u \ | ||
| xargs bashbrew cat --format '[{{ .RepoName }}:{{ .TagName }}]="{{ join " " .TagEntry.Architectures }}"' | ||
) )" | ||
} | ||
_generateParentRepoToArches 'percona' | ||
|
||
parentArches() { | ||
local version="$1"; shift # "1.8", etc | ||
|
||
local parent="$(awk 'toupper($1) == "FROM" { print $2 }' "$version/Dockerfile")" | ||
echo "${parentRepoToArches[$parent]:-}" | ||
} | ||
versionArches() { | ||
local version="$1"; shift # "1.8", etc | ||
|
||
local parentArches="$(parentArches "$version")" | ||
|
||
local variantArches=() | ||
for arch in $parentArches; do | ||
if hasBashbrewArch "$version" "$arch"; then | ||
variantArches+=( "$arch" ) | ||
fi | ||
done | ||
echo "${variantArches[*]}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.