Merge pull request #169 from infosiftr/refactor

Move helper scripts and templates to a directory
This commit is contained in:
Tianon Gravi 2015-02-24 14:42:57 -07:00
commit 7ffc053f65
6 changed files with 15 additions and 14 deletions

View File

@ -25,19 +25,19 @@ Optionally: (we run this periodically, especially before pushing updated descrip
This is the main script used to generate the `README.md` files for each image. The generated file is committed along with the files used to generate it (see below on what customizations are available). When a new image is added that is not under the `docker-library` namespace on GitHub, a new entry must be added to the `otherRepos` array in this script. Accepted arguments are which image(s) you want to update and no arguments to update all of them.
## `push.pl`
This is used by us to push the actual content of the READMEs to the Docker Hub as special access is required to modify the Hub description contents.
## `generate-dockerfile-links-partial.sh`
This script is used by `update.sh` to create the "Supported tags and respective `Dockerfile` links" section of each generated `README.md` from the information in the [official-images `library/` manifests](https://github.com/docker-library/official-images/tree/master/library).
## `generate-repo-stub-readme.sh`
This is used to generate a simple `README.md` to put in the image's repo. Argument is the name of the image, like `golang` and it then outputs the readme to standard out.
## `README-template.md` and `user-feedback.md`
## `push.pl`
This is used by us to push the actual content of the READMEs to the Docker Hub as special access is required to modify the Hub description contents.
## `.template-helpers/generate-dockerfile-links-partial.sh`
This script is used by `update.sh` to create the "Supported tags and respective `Dockerfile` links" section of each generated `README.md` from the information in the [official-images `library/` manifests](https://github.com/docker-library/official-images/tree/master/library).
## `.template-helpers/template.md` and `.template-helpers/user-feedback.md`
These files are the templates used in building the `<image name>/README.md` file, in combination with the individual image's files.

View File

@ -2,6 +2,7 @@
set -e
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
helperDir='.template-helpers'
repos=( "$@" )
if [ ${#repos[@]} -eq 0 ]; then
@ -78,9 +79,9 @@ for repo in "${repos[@]}"; do
mailingList=' '
fi
dockerVersions="$(cat "$repo/docker-versions.md" 2>/dev/null || cat 'docker-versions.md')"
dockerVersions="$(cat "$repo/docker-versions.md" 2>/dev/null || cat "$helperDir/docker-versions.md")"
userFeedback="$(cat "$repo/user-feedback.md" 2>/dev/null || cat 'user-feedback.md')"
userFeedback="$(cat "$repo/user-feedback.md" 2>/dev/null || cat "$helperDir/user-feedback.md")"
license="$(cat "$repo/license.md" 2>/dev/null || true)"
if [ "$license" ]; then
@ -92,10 +93,10 @@ for repo in "${repos[@]}"; do
logo="![logo](https://raw.githubusercontent.com/docker-library/docs/master/$repo/logo.png)"
fi
cp -v README-template.md "$repo/README.md"
cp -v "$helperDir/template.md" "$repo/README.md"
echo ' TAGS => ./generate-dockerfile-links-partial.sh'
replace_field "$repo" 'TAGS' "$(./generate-dockerfile-links-partial.sh "$repo")"
echo ' TAGS => generate-dockerfile-links-partial.sh'
replace_field "$repo" 'TAGS' "$("$helperDir/generate-dockerfile-links-partial.sh" "$repo")"
echo ' CONTENT => '"$repo"'/content.md'
replace_field "$repo" 'CONTENT' "$(cat "$repo/content.md")"