File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4242
4343echo " install_path: $install_path version: $version "
4444
45+ build_docs () {
46+ set +e
47+ set -o pipefail
48+ make $1 2>&1 | tee /tmp/docs_build.txt
49+ code=$?
50+ if [ $code -ne 0 ]; then
51+ set +x
52+ echo =========================
53+ grep " WARNING:" /tmp/docs_build.txt
54+ echo =========================
55+ echo Docs build failed. If the failure is not clear, scan back in the log
56+ echo for any WARNINGS or for the line " build finished with problems"
57+ echo " (tried to echo the WARNINGS above the ==== line)"
58+ echo =========================
59+ fi
60+ set -ex
61+ return $code
62+ }
63+
64+
4565git clone https://github.com/pytorch/pytorch.github.io -b $branch
4666pushd pytorch.github.io
4767
@@ -57,7 +77,8 @@ pushd docs
5777# Build the docs
5878pip -q install -r requirements.txt
5979if [ " $is_master_doc " = true ]; then
60- make html
80+ build_docs html
81+ [ $? -eq 0 ] || exit $?
6182 make coverage
6283 # Now we have the coverage report, we need to make sure it is empty.
6384 # Count the number of lines in the file and turn that number into a variable
@@ -78,8 +99,9 @@ if [ "$is_master_doc" = true ]; then
7899 exit 1
79100 fi
80101else
81- # Don't fail the build on coverage problems
82- make html-stable
102+ # skip coverage, format for stable or tags
103+ build_docs html-stable
104+ [ $? -eq 0 ] || exit $?
83105fi
84106
85107# Move them into the docs repo
You can’t perform that action at this time.
0 commit comments