diff --git a/docker-versions.md b/.template-helpers/docker-versions.md similarity index 100% rename from docker-versions.md rename to .template-helpers/docker-versions.md diff --git a/generate-dockerfile-links-partial.sh b/.template-helpers/generate-dockerfile-links-partial.sh similarity index 100% rename from generate-dockerfile-links-partial.sh rename to .template-helpers/generate-dockerfile-links-partial.sh diff --git a/README-template.md b/.template-helpers/template.md similarity index 100% rename from README-template.md rename to .template-helpers/template.md diff --git a/user-feedback.md b/.template-helpers/user-feedback.md similarity index 100% rename from user-feedback.md rename to .template-helpers/user-feedback.md diff --git a/README.md b/README.md index 9d1b9e161..faa14450c 100644 --- a/README.md +++ b/README.md @@ -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 `/README.md` file, in combination with the individual image's files. diff --git a/update.sh b/update.sh index f10b3ff41..d6bc294c0 100755 --- a/update.sh +++ b/update.sh @@ -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")"