Skip to content

Commit

Permalink
Make sure README.md does not exceed 25k char limit of Docker Hub (#291)
Browse files Browse the repository at this point in the history
Signed-off-by: Wouter Born <github@maindrain.net>
  • Loading branch information
wborn committed Apr 19, 2020
1 parent a227b6a commit 1e5d325
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 5 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ before_install:
- docker info
- docker run --rm --privileged multiarch/qemu-user-static:register --reset
- source ./update-functions.sh
- validate_readme_constraints
- ARCHES="$(arches $VERSION $DIST)"
install:
- for ARCH in $ARCHES; do
Expand Down
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,7 @@ Comments, suggestions and contributions are welcome!
* `2.2.0` Stable openHAB 2.2.0 version ([Dockerfile](https://github.com/openhab/openhab-docker/blob/master/2.2.0/debian/Dockerfile-amd64))
* `2.3.0` Stable openHAB 2.3.0 version ([Dockerfile](https://github.com/openhab/openhab-docker/blob/master/2.3.0/debian/Dockerfile-amd64))
* `2.4.0` Stable openHAB 2.4.0 version ([Dockerfile](https://github.com/openhab/openhab-docker/blob/master/2.4.0/debian/Dockerfile-amd64))
* `2.5.0` Stable openHAB 2.5.0 version ([Dockerfile](https://github.com/openhab/openhab-docker/blob/master/2.5.0/debian/Dockerfile-amd64))
* `2.5.1` Stable openHAB 2.5.1 version ([Dockerfile](https://github.com/openhab/openhab-docker/blob/master/2.5.1/debian/Dockerfile-amd64))
* `2.5.2` Stable openHAB 2.5.2 version ([Dockerfile](https://github.com/openhab/openhab-docker/blob/master/2.5.2/debian/Dockerfile-amd64))
* `2.5.3` Stable openHAB 2.5.3 version ([Dockerfile](https://github.com/openhab/openhab-docker/blob/master/2.5.3/debian/Dockerfile-amd64))
* `2.5.4` Stable openHAB 2.5.4 version ([Dockerfile](https://github.com/openhab/openhab-docker/blob/master/2.5.4/debian/Dockerfile-amd64))
* `2.5.0` - `2.5.4` Stable openHAB 2.5.x version ([Dockerfile](https://github.com/openhab/openhab-docker/blob/master/2.5.4/debian/Dockerfile-amd64))
* `2.5.5-snapshot` Experimental openHAB 2.5.5 SNAPSHOT version ([Dockerfile](https://github.com/openhab/openhab-docker/blob/master/2.5.5-snapshot/debian/Dockerfile-amd64))
* `3.0.0-snapshot` Experimental openHAB 3.0.0 SNAPSHOT version ([Dockerfile](https://github.com/openhab/openhab-docker/blob/master/3.0.0-snapshot/debian/Dockerfile-amd64))

Expand Down
8 changes: 8 additions & 0 deletions update-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,11 @@ last_milestone_version() {
build_versions() {
echo "$(stable_versions) $(milestone_versions) $(snapshot_versions)"
}

validate_readme_constraints() {
count=$(wc -m <README.md)
if [[ $count -ge 25000 ]]; then
echo "README.md contains $count characters which exceeds the 25000 character limit of Docker Hub"
exit 1;
fi
}
6 changes: 6 additions & 0 deletions update-readme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ generate_version_list() {
2.*-snapshot|3.*-snapshot)
echo "* \`$version\` Experimental openHAB $(echo $version | sed 's/-snapshot/ SNAPSHOT/g') version ([Dockerfile]($url))"
;;
$(last_stable_version))
echo "* \`2.5.0\` - \`$version\` Stable openHAB $(echo $version | sed -E 's/^([0-9]+)\.([0-9])+\.([0-9])+$/\1\.\2\.x/g') version ([Dockerfile]($url))"
;;
2.5.*)
;;
*)
echo "* \`$version\` Stable openHAB $version version ([Dockerfile]($url))"
;;
Expand Down Expand Up @@ -48,5 +53,6 @@ echo -n "Writing $file... "

update_version_list
update_last_stable_version
validate_readme_constraints

echo "done"
1 change: 1 addition & 0 deletions update-travis-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ print_static_configuration() {
- docker info
- docker run --rm --privileged multiarch/qemu-user-static:register --reset
- source ./update-functions.sh
- validate_readme_constraints
- ARCHES="$(arches $VERSION $DIST)"
install:
- for ARCH in $ARCHES; do
Expand Down

0 comments on commit 1e5d325

Please sign in to comment.