forked from docker-library/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
61 lines (58 loc) · 1.94 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
language: go
sudo: false
install:
- 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
script:
- 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
- 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
- failed='';
for repo in */; do
if [ ! -e "$repo/github-repo" ]; then
failed+=" $repo";
fi
done;
if [ "$failed" ]; then
echo >&2 "Missing github-repo for:$failed";
exit 1;
fi
- 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