forked from docker-library/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenerate-repo-stub-readme.sh
executable file
·37 lines (25 loc) · 1.83 KB
/
generate-repo-stub-readme.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
set -e
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
repo="$1"
if [ -z "$repo" ]; then
echo >&2 'error: no repo specified'
cat >&2 <<EOUSAGE
usage: $0 repo [> README.md]
ie: $0 php > ../php/README.md
This script generates a stub README to standard out for the specified repo.
EOUSAGE
exit 1
fi
gitRepo='https://github.com/docker-library/docs'
hubPage="https://registry.hub.docker.com/_/$repo/"
canonicalRepo="$(curl -fsSLI -o /dev/null -w '%{url_effective}\n' "https://github.com/docker-library/$repo")" # follow redirects (http://stackoverflow.com/a/3077316/433558)
travisRepo="${canonicalRepo#*://github.com/}"
cat <<EOREADME
# About this Repo
This is the Git repo of the Docker [official image](https://docs.docker.com/docker-hub/official_repos/) for [$repo]($hubPage). See [the Docker Hub page]($hubPage) for the full readme on how to use this Docker image and for information regarding contributing and issues.
The full readme is generated over in [docker-library/docs]($gitRepo), specifically in [docker-library/docs/$repo]($gitRepo/tree/master/$repo).
See a change merged here that doesn't show up on the Docker Hub yet? 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). 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).
[![Travis CI](https://img.shields.io/travis/$travisRepo/master.svg)](https://travis-ci.org/$travisRepo/branches)
<!-- THIS FILE IS GENERATED BY https://github.com/docker-library/docs/blob/master/generate-repo-stub-readme.sh -->
EOREADME