forked from docker-library/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request docker-library#887 from infosiftr/travis-refactor
Refactor Travis to use a series of short scripts so that the output is cleaner (and easier to manage / test locally)
- Loading branch information
Showing
6 changed files
with
93 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env bash | ||
set -Eeuo pipefail | ||
|
||
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")/.." | ||
|
||
files="$(find -name '*.md' -print0 | xargs -0 markdownfmt -l)" | ||
if [ "$files" ]; then | ||
echo >&2 'Need markdownfmt:' | ||
echo >&2 "$files" | ||
echo >&2 | ||
echo "$files" | xargs markdownfmt -d >&2 | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env bash | ||
set -Eeuo pipefail | ||
|
||
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")/.." | ||
|
||
if [ "$TRAVIS_PULL_REQUEST" != 'false' ]; then | ||
if [ "$(git diff --numstat "$TRAVIS_COMMIT_RANGE" -- '*/README.md')" ]; then | ||
echo >&2 'Error: at least one repo README.md has changed' | ||
echo >&2 'These files are autogenerated, so it is unnecessary to modify them' | ||
echo >&2 'Please update content.md and docker-library-bot will take care of README.md' | ||
echo >&2 'See: https://github.com/docker-library/docs/#image-namereadmemd' | ||
echo >&2 | ||
exit 1 | ||
fi | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env bash | ||
set -Eeuo pipefail | ||
|
||
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")/.." | ||
|
||
exitCode=0 | ||
for requiredFile in \ | ||
content.md \ | ||
github-repo \ | ||
; do | ||
failed='' | ||
for repo in */; do | ||
case "${repo%/}" in | ||
scratch) continue ;; | ||
esac | ||
if [ ! -e "$repo/$requiredFile" ]; then | ||
failed+=" $repo" | ||
fi | ||
done | ||
if [ "$failed" ]; then | ||
echo >&2 "Missing $requiredFile for:$failed" | ||
exitCode=1 | ||
fi | ||
done | ||
exit "$exitCode" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env bash | ||
set -Eeuo pipefail | ||
|
||
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")/.." | ||
|
||
failed='' | ||
for short in */README-short.txt; do | ||
chars="$(echo -n "$(cat "$short")" | wc -m)" | ||
lines="$(cat "$short" | wc -l)" | ||
if [ "$chars" -gt 100 -o "$lines" -gt 1 ]; then | ||
failed+=" $short" | ||
fi | ||
done | ||
|
||
if [ "$failed" ]; then | ||
echo >&2 "Too long (or too many lines):$failed" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env bash | ||
set -Eeuo pipefail | ||
|
||
set -x | ||
[ -n "$GOPATH" ] | ||
export GOPATH_FIRST="${GOPATH%%:*}" | ||
git clone \ | ||
--depth 1 \ | ||
https://github.com/tianon/markdownfmt.git \ | ||
"$GOPATH_FIRST/src/github.com/shurcooL/markdownfmt" | ||
export BLACKFRIDAY_VERSION="$(awk '$1 == "ENV" && $2 == "BLACKFRIDAY_VERSION" { print $3; exit }' "$GOPATH_FIRST/src/github.com/shurcooL/markdownfmt/Dockerfile")" | ||
git clone \ | ||
--depth 1 \ | ||
-b "$BLACKFRIDAY_VERSION" \ | ||
https://github.com/russross/blackfriday.git \ | ||
"$GOPATH_FIRST/src/github.com/russross/blackfriday" | ||
go get -v github.com/shurcooL/markdownfmt |