Skip to content

Commit 13ee7f3

Browse files
authored
Merge pull request #2503 from infosiftr/repo-stub-no-badges
Remove badges from "repo stub readme" contents
2 parents 77ae189 + 6e2a154 commit 13ee7f3

File tree

1 file changed

+0
-87
lines changed

1 file changed

+0
-87
lines changed

generate-repo-stub-readme.sh

-87
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,6 @@ if [ -s "$repo/github-repo" ]; then
2424
canonicalRepo="$(< "$repo/github-repo")"
2525
fi
2626
canonicalRepo="$(curl -fsSLI -o /dev/null -w '%{url_effective}\n' "$canonicalRepo")" # follow redirects (http://stackoverflow.com/a/3077316/433558)
27-
githubRepoName="${canonicalRepo#*://github.com/}"
28-
29-
case "$githubRepoName" in
30-
# Elastic points "github-repo" at their upstream elastic/xyz-docker repos, but we want our README stubs to still point at our integration repos
31-
elastic/*) githubRepoName="docker-library/$repo" ;;
32-
33-
hylang/hy) githubRepoName='hylang/docker-hylang' ;;
34-
esac
3527

3628
maintainer="$(sed -e 's!%%GITHUB-REPO%%!'"$canonicalRepo"'!g' "$repo/maintainer.md")"
3729

@@ -61,85 +53,6 @@ The [full image description on Docker Hub]($hubPage) is generated/maintained ove
6153
For more information about the full official images change lifecycle, see [the "An image's source changed in Git, now what?" FAQ entry](https://github.com/docker-library/faq#an-images-source-changed-in-git-now-what).
6254
6355
For outstanding \`$repo\` image PRs, check [PRs with the "library/$repo" label on the official-images repository](https://github.com/docker-library/official-images/labels/library%2F$repo). For the current "source of truth" for [\`$repo\`]($hubPage), see [the \`library/$repo\` file in the official-images repository](https://github.com/docker-library/official-images/blob/master/library/$repo).
64-
EOREADME
65-
66-
badges=()
67-
68-
n=$'\n'
69-
t=$'\t'
70-
71-
branch='master'
72-
toTest=(
73-
# "image badge URL"
74-
# "image badge link/href"
75-
# "badge test URL (to determine whether badge applies)"
76-
77-
"https://img.shields.io/github/actions/workflow/status/$githubRepoName/ci.yml?branch=$branch&label=GitHub%20CI"
78-
"https://github.com/$githubRepoName/actions?query=workflow%3A%22GitHub+CI%22+branch%3A$branch"
79-
"https://github.com/$githubRepoName/blob/$branch/.github/workflows/ci.yml"
80-
81-
"https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/update.sh/job/$repo.svg?label=Automated%20update.sh"
82-
"https://doi-janky.infosiftr.net/job/update.sh/job/$repo/"
83-
"https://doi-janky.infosiftr.net/job/update.sh/job/$repo/"
84-
)
85-
86-
_wget_spider() {
87-
wget -q -o /dev/null -O /dev/null --spider "$@"
88-
}
89-
90-
set -- "${toTest[@]}"
91-
while [ "$#" -gt 0 ]; do
92-
image="$1"; shift
93-
url="$1"; shift
94-
testUrl="$1"; shift
95-
if _wget_spider "$testUrl"; then
96-
badges+=( "-${t}[![build status badge]($image)]($url)" )
97-
fi
98-
done
99-
100-
arches="$(bashbrew cat --format '{{ range .Entries }}{{ join "\n" .Architectures }}{{ "\n" }}{{ end }}' "https://github.com/docker-library/official-images/raw/master/library/$repo" | sort -u)"
101-
if [ -n "$arches" ]; then
102-
archTable=
103-
i=0
104-
for arch in $arches put-shared; do
105-
if [ "$arch" = 'put-shared' ]; then
106-
jenkinsJob="job/put-shared/job/light/job/$repo"
107-
if ! _wget_spider "https://doi-janky.infosiftr.net/$jenkinsJob/"; then
108-
jenkinsJob='job/put-shared/job/heavy'
109-
fi
110-
else
111-
jenkinsJob="job/multiarch/job/$arch/job/$repo"
112-
fi
113-
jenkinsLink="https://doi-janky.infosiftr.net/$jenkinsJob/"
114-
jenkinsImage="https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/$jenkinsJob.svg?label=$arch"
115-
if _wget_spider "$jenkinsLink"; then
116-
archTable="${archTable:-|} [![$arch build status badge]($jenkinsImage)]($jenkinsLink) |"
117-
(( i = (i + 1) % 4 )) || : # modulo here needs to match the number of colums used below
118-
if [ "$i" = 0 ]; then
119-
archTable+="${n}|"
120-
fi
121-
fi
122-
done
123-
if [ -n "$archTable" ]; then
124-
if [ "${#badges[@]}" -gt 0 ]; then
125-
badges+=( '' )
126-
fi
127-
badges+=( "| Build | Status | Badges | (per-arch) |${n}|:-:|:-:|:-:|:-:|${n}${archTable%${n}|}" )
128-
fi
129-
fi
130-
131-
if [ "${#badges[@]}" -gt 0 ]; then
132-
IFS=$'\n'
133-
cat <<-EOREADME
134-
135-
---
136-
137-
${badges[*]}
138-
EOREADME
139-
unset IFS
140-
fi
141-
142-
cat <<EOREADME
14356
14457
<!-- THIS FILE IS GENERATED BY $gitRepo/blob/master/generate-repo-stub-readme.sh -->
14558
EOREADME

0 commit comments

Comments
 (0)