Browse Source

Move helper scripts and templates to a directory

Joe Ferguson 10 years ago
parent
commit
f7c900fdbc

+ 0 - 0
docker-versions.md → .template-helpers/docker-versions.md


+ 0 - 0
generate-dockerfile-links-partial.sh → .template-helpers/generate-dockerfile-links-partial.sh


+ 0 - 0
README-template.md → .template-helpers/template.md


+ 0 - 0
user-feedback.md → .template-helpers/user-feedback.md


+ 6 - 6
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.
 
+## `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.
+
 ## `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`
+## `.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).
 
-## `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`
+## `.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.
 

+ 6 - 5
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")"