Skip to content

Commit 635c357

Browse files
committed
Update build badges and improve "generate-repo-stub-readme.sh"
Especially to link to the new FAQ entry (https://github.com/docker-library/faq#an-images-source-changed-in-git-now-what)
1 parent aec5bdc commit 635c357

File tree

3 files changed

+47
-35
lines changed

3 files changed

+47
-35
lines changed

README.md

+15-8
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
# What is this?
22

3-
This repository contains the docs for each of the Docker official images. See [docker-library/official-images](https://github.com/docker-library/official-images) for the configuration how the images are built. To see all of the official images go to the [hub](https://hub.docker.com/explore/).
4-
5-
All Markdown files here are run through [tianon's fork of `markdownfmt`](https://github.com/tianon/markdownfmt) (only forked to add some smaller-diff preference and minor DockerHub-compatibility changes), and verified as formatted correctly via Travis-CI.
6-
7-
- [Travis CI:
8-
![build status badge](https://travis-ci.org/docker-library/docs.svg?branch=master)](https://travis-ci.org/docker-library/docs)
9-
- [Automated `update.sh` and `push.sh`:
10-
![build status badge](https://doi-janky.infosiftr.net/job/docs/job/update/badge/icon)](https://doi-janky.infosiftr.net/job/docs/job/update/)
3+
This repository contains the image documentation for each of the official images. See [docker-library/official-images](https://github.com/docker-library/official-images) for more information about the program in general.
4+
5+
All Markdown files here are run through [tianon's fork of `markdownfmt`](https://github.com/tianon/markdownfmt) (only forked to add some smaller-diff preference and minor DockerHub-compatibility changes), and verified as formatted correctly via Travis CI.
6+
7+
- [![Travis CI status badge](https://img.shields.io/travis/docker-library/docs/master.svg?label=Travis%20CI)](https://travis-ci.org/docker-library/docs)
8+
- [![library update.sh status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/docs/job/library.svg?label=Automated%20library%20update.sh)](https://doi-janky.infosiftr.net/job/docs/job/library/)
9+
- [![amd64 update.sh status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/docs/job/amd64.svg?label=Automated%20amd64%20update.sh)](https://doi-janky.infosiftr.net/job/docs/job/amd64/)
10+
- [![arm32v5 update.sh status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/docs/job/arm32v5.svg?label=Automated%20arm32v5%20update.sh)](https://doi-janky.infosiftr.net/job/docs/job/arm32v5/)
11+
- [![arm32v6 update.sh status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/docs/job/arm32v6.svg?label=Automated%20arm32v6%20update.sh)](https://doi-janky.infosiftr.net/job/docs/job/arm32v6/)
12+
- [![arm32v7 update.sh status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/docs/job/arm32v7.svg?label=Automated%20arm32v7%20update.sh)](https://doi-janky.infosiftr.net/job/docs/job/arm32v7/)
13+
- [![arm64v8 update.sh status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/docs/job/arm64v8.svg?label=Automated%20arm64v8%20update.sh)](https://doi-janky.infosiftr.net/job/docs/job/arm64v8/)
14+
- [![i386 update.sh status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/docs/job/i386.svg?label=Automated%20i386%20update.sh)](https://doi-janky.infosiftr.net/job/docs/job/i386/)
15+
- [![ppc64le update.sh status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/docs/job/ppc64le.svg?label=Automated%20ppc64le%20update.sh)](https://doi-janky.infosiftr.net/job/docs/job/ppc64le/)
16+
- [![s390x update.sh status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/docs/job/s390x.svg?label=Automated%20s390x%20update.sh)](https://doi-janky.infosiftr.net/job/docs/job/s390x/)
17+
- [![windows-amd64 update.sh status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/docs/job/windows-amd64.svg?label=Automated%20windows-amd64%20update.sh)](https://doi-janky.infosiftr.net/job/docs/job/windows-amd64/)
1118

1219
## Table of Contents
1320

generate-repo-stub-readme.sh

+30-26
Original file line numberDiff line numberDiff line change
@@ -45,58 +45,62 @@ cat <<EOREADME
4545
4646
## Maintained by: $maintainer
4747
48-
This is the Git repo of the [Docker "Official Image"](https://github.com/docker-library/official-images#what-are-official-images) for [$repo]($hubPage) (not to be confused with any official $repo image provided by $repo upstream). See [the Docker Hub page]($hubPage) for the full readme on how to use this Docker image and for information regarding contributing and issues.
48+
This is the Git repo of the [Docker "Official Image"](https://github.com/docker-library/official-images#what-are-official-images) for [\`$repo\`]($hubPage) (not to be confused with any official \`$repo\` image provided by \`$repo\` upstream). See [the Docker Hub page]($hubPage) for the full readme on how to use this Docker image and for information regarding contributing and issues.
4949
50-
The [full description from Docker Hub]($hubPage) is generated over in [docker-library/docs]($gitRepo), specifically in [docker-library/docs/$repo]($gitRepo/tree/master/$repo).
50+
The [full image description on Docker Hub]($hubPage) is generated/maintained over in [the docker-library/docs repository]($gitRepo), specifically in [the \`$repo\` directory]($gitRepo/tree/master/$repo).
5151
5252
## See a change merged here that doesn't show up on Docker Hub yet?
5353
54-
Check [the "library/$repo" manifest file in the docker-library/official-images repo](https://github.com/docker-library/official-images/blob/master/library/$repo), especially [PRs with the "library/$repo" label on that repo](https://github.com/docker-library/official-images/labels/library%2F$repo).
54+
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).
5555
56-
For more information about the official images process, see the [docker-library/official-images readme](https://github.com/docker-library/official-images/blob/master/README.md).
56+
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).
5757
EOREADME
5858

5959
badges=()
6060

6161
n=$'\n'
6262
t=$'\t'
6363

64-
travisImage="https://img.shields.io/travis/$travisRepo/master.svg"
65-
if svg="$(wget -qO- "$travisImage" 2>/dev/null)" && [[ "$svg" != *unknown* ]]; then
66-
travisLink="https://travis-ci.org/$travisRepo/branches"
67-
badges+=( "-${t}[Travis CI: ${n}${t}![build status badge]($travisImage)]($travisLink)" )
68-
fi
69-
70-
# https://www.appveyor.com/docs/status-badges/#badges-for-projects-with-public-repositories-on-github-and-bitbucket
71-
appveyorImage="https://ci.appveyor.com/api/projects/status/github/docker-library/$repo?branch=master&svg=true"
72-
if svg="$(wget -qO- "$appveyorImage" 2>/dev/null)" && [[ "$svg" != *unknown* ]]; then
73-
appveyorLink="https://ci.appveyor.com/project/docker-library/$repo"
74-
badges+=( "-${t}[AppVeyor (Windows): ${n}${t}![build status badge]($appveyorImage)]($appveyorLink)" )
75-
fi
76-
77-
jenkinsImage="https://doi-janky.infosiftr.net/job/update.sh/job/$repo/badge/icon"
78-
if wget -q --spider "$jenkinsImage" &> /dev/null; then
79-
jenkinsLink="https://doi-janky.infosiftr.net/job/update.sh/job/$repo"
80-
badges+=( "-${t}[Automated \`update.sh\`: ${n}${t}![build status badge]($jenkinsImage)]($jenkinsLink)" )
81-
fi
64+
toTest=(
65+
"https://img.shields.io/travis/$travisRepo/master.svg?label=Travis%20CI" "https://travis-ci.org/$travisRepo/branches"
66+
"https://img.shields.io/appveyor/ci/$travisRepo/master.svg?label=AppVeyor" "https://ci.appveyor.com/project/$travisRepo"
67+
"https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/update.sh/job/$repo.svg?label=Automated%20update.sh" "https://doi-janky.infosiftr.net/job/update.sh/job/$repo"
68+
)
69+
70+
_check_shields_io_image() {
71+
wget -qO- "$1" 2>/dev/null \
72+
| grep -qvE 'unknown|invalid|access denied|not found'
73+
}
74+
75+
set -- "${toTest[@]}"
76+
while [ "$#" -gt 0 ]; do
77+
image="$1"; shift
78+
url="$1"; shift
79+
if _check_shields_io_image "$image"; then
80+
badges+=( "-${t}[![build status badge]($image)]($url)" )
81+
fi
82+
done
8283

8384
arches="$(bashbrew cat --format '{{ range .Entries }}{{ join "\n" .Architectures }}{{ "\n" }}{{ end }}' "https://github.com/docker-library/official-images/raw/master/library/$repo" | sort -u)"
8485
if [ -n "$arches" ]; then
8586
archTable=
8687
i=0
8788
for arch in $arches; do
8889
jenkinsLink="https://doi-janky.infosiftr.net/job/multiarch/job/$arch/job/$repo"
89-
jenkinsImage="$jenkinsLink/badge/icon"
90-
if wget -q --spider "$jenkinsImage" &> /dev/null; then
91-
archTable="${archTable:-|} [\`$arch\`<br />![build status badge]($jenkinsImage)]($jenkinsLink) |"
90+
jenkinsImage="https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/$arch/job/$repo.svg?label=$arch"
91+
if _check_shields_io_image "$jenkinsImage"; then
92+
archTable="${archTable:-|} [![$arch build status badge]($jenkinsImage)]($jenkinsLink) |"
9293
(( i = (i + 1) % 4 )) || : # modulo here needs to match the number of colums used below
9394
if [ "$i" = 0 ]; then
9495
archTable+="${n}|"
9596
fi
9697
fi
9798
done
9899
if [ -n "$archTable" ]; then
99-
badges+=( "${n}| Build | Status | Badges | (per-arch) |${n}|:-:|:-:|:-:|:-:|${n}${archTable%${n}|}" )
100+
if [ "${#badges[@]}" -gt 0 ]; then
101+
badges+=( '' )
102+
fi
103+
badges+=( "| Build | Status | Badges | (per-arch) |${n}|:-:|:-:|:-:|:-:|${n}${archTable%${n}|}" )
100104
fi
101105
fi
102106

update.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ for image in "${images[@]}"; do
142142
fi
143143
elif [ -n "$ARCH_SPECIFIC_DOCS" ]; then
144144
jenkinsJobUrl="https://doi-janky.infosiftr.net/job/multiarch/job/$BASHBREW_ARCH/job/$repo/"
145-
partial+=$'\n\n''[![Build Status]('"${jenkinsJobUrl%/}"'/badge/icon) (`%%IMAGE%%` build job)]('"$jenkinsJobUrl"')'
145+
jenkinsImageUrl="https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/$BASHBREW_ARCH/job/$repo.svg?label=%%IMAGE%%%20%20build%20job"
146+
partial+=$'\n\n''[![%%IMAGE%% build status badge]('"$jenkinsImageUrl"')]('"$jenkinsJobUrl"')'
146147
fi
147148
replace_field "$targetFile" 'TAGS' "$partial"
148149

0 commit comments

Comments
 (0)