2017-04-26 19:15:44 +00:00
|
|
|
#!/usr/bin/env bash
|
2016-05-04 08:38:36 +00:00
|
|
|
#
|
|
|
|
# Perform sanity checks on documentation and build it.
|
|
|
|
#
|
|
|
|
|
2019-01-27 23:26:50 +00:00
|
|
|
. ${0%/*}/lib.sh
|
2017-09-10 14:44:28 +00:00
|
|
|
|
ci/lib.sh: encapsulate Travis-specific things
The upcoming patches will allow building git.git via Azure Pipelines
(i.e. Azure DevOps' Continuous Integration), where variable names and
URLs look a bit different than in Travis CI.
Also, the configurations of the available agents are different. For
example, Travis' and Azure Pipelines' macOS agents are set up
differently, so that on Travis, we have to install the git-lfs and
gettext Homebrew packages, and on Azure Pipelines we do not need to.
Likewise, Azure Pipelines' Ubuntu agents already have asciidoctor
installed.
Finally, on Azure Pipelines the natural way is not to base64-encode tar
files of the trash directories of failed tests, but to publish build
artifacts instead. Therefore, that code to log those base64-encoded tar
files is guarded to be Travis-specific.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-01-27 23:26:51 +00:00
|
|
|
test -n "$ALREADY_HAVE_ASCIIDOCTOR" ||
|
2017-09-10 14:44:28 +00:00
|
|
|
gem install asciidoctor
|
2016-05-04 08:38:36 +00:00
|
|
|
|
|
|
|
make check-builtins
|
|
|
|
make check-docs
|
|
|
|
|
2017-04-11 08:33:07 +00:00
|
|
|
# Build docs with AsciiDoc
|
2019-01-27 23:26:52 +00:00
|
|
|
make doc > >(tee stdout.log) 2> >(tee stderr.log >&2)
|
2017-04-26 19:15:44 +00:00
|
|
|
! test -s stderr.log
|
2016-05-04 08:38:36 +00:00
|
|
|
test -s Documentation/git.html
|
|
|
|
test -s Documentation/git.xml
|
|
|
|
test -s Documentation/git.1
|
2017-04-11 08:33:07 +00:00
|
|
|
grep '<meta name="generator" content="AsciiDoc ' Documentation/git.html
|
|
|
|
|
2017-12-31 16:02:06 +00:00
|
|
|
rm -f stdout.log stderr.log
|
|
|
|
check_unignored_build_artifacts
|
|
|
|
|
2017-04-11 08:33:07 +00:00
|
|
|
# Build docs with AsciiDoctor
|
|
|
|
make clean
|
2019-01-27 23:26:52 +00:00
|
|
|
make USE_ASCIIDOCTOR=1 doc > >(tee stdout.log) 2> >(tee stderr.log >&2)
|
2017-04-26 19:15:44 +00:00
|
|
|
sed '/^GIT_VERSION = / d' stderr.log
|
|
|
|
! test -s stderr.log
|
2017-04-11 08:33:07 +00:00
|
|
|
test -s Documentation/git.html
|
|
|
|
grep '<meta name="generator" content="Asciidoctor ' Documentation/git.html
|
travis-ci: record and skip successfully built trees
Travis CI dutifully builds and tests each new branch tip, even if its
tree has previously been successfully built and tested. This happens
often enough in contributors' workflows, when a work-in-progress
branch is rebased changing e.g. only commit messages or the order or
number of commits while leaving the resulting code intact, and is then
pushed to a Travis CI-enabled GitHub fork.
This is wasting Travis CI's resources and is sometimes scary-annoying
when the new tip commit with a tree identical to the previous,
successfully tested one is suddenly reported in red, because one of
the OSX build jobs happened to exceed the time limit yet again.
So extend our Travis CI build scripts to skip building commits whose
trees have previously been successfully built and tested. Use the
Travis CI cache feature to keep a record of the object names of trees
that tested successfully, in a plain and simple flat text file, one
line per tree object name. Append the current tree's object name at
the end of every successful build job to this file, along with a bit
of additional info about the build job (commit object name, Travis CI
job number and id). Limit the size of this file to 1000 records, to
prevent it from growing too large for git/git's forever living
integration branches. Check, using a simple grep invocation, in each
build job whether the current commit's tree is already in there, and
skip the build if it is. Include a message in the skipped build job's
trace log, containing the URL to the build job successfully testing
that tree for the first time and instructions on how to force a
re-build. Catch the case when a build job, which successfully built
and tested a particular tree for the first time, is restarted and omit
the URL of the previous build job's trace log, as in this case it's
the same build job and the trace log has just been overwritten.
Note: this won't kick in if two identical trees are on two different
branches, because Travis CI caches are not shared between build jobs
of different branches.
Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Reviewed-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-12-31 10:12:05 +00:00
|
|
|
|
2017-12-31 16:02:06 +00:00
|
|
|
rm -f stdout.log stderr.log
|
|
|
|
check_unignored_build_artifacts
|
|
|
|
|
travis-ci: record and skip successfully built trees
Travis CI dutifully builds and tests each new branch tip, even if its
tree has previously been successfully built and tested. This happens
often enough in contributors' workflows, when a work-in-progress
branch is rebased changing e.g. only commit messages or the order or
number of commits while leaving the resulting code intact, and is then
pushed to a Travis CI-enabled GitHub fork.
This is wasting Travis CI's resources and is sometimes scary-annoying
when the new tip commit with a tree identical to the previous,
successfully tested one is suddenly reported in red, because one of
the OSX build jobs happened to exceed the time limit yet again.
So extend our Travis CI build scripts to skip building commits whose
trees have previously been successfully built and tested. Use the
Travis CI cache feature to keep a record of the object names of trees
that tested successfully, in a plain and simple flat text file, one
line per tree object name. Append the current tree's object name at
the end of every successful build job to this file, along with a bit
of additional info about the build job (commit object name, Travis CI
job number and id). Limit the size of this file to 1000 records, to
prevent it from growing too large for git/git's forever living
integration branches. Check, using a simple grep invocation, in each
build job whether the current commit's tree is already in there, and
skip the build if it is. Include a message in the skipped build job's
trace log, containing the URL to the build job successfully testing
that tree for the first time and instructions on how to force a
re-build. Catch the case when a build job, which successfully built
and tested a particular tree for the first time, is restarted and omit
the URL of the previous build job's trace log, as in this case it's
the same build job and the trace log has just been overwritten.
Note: this won't kick in if two identical trees are on two different
branches, because Travis CI caches are not shared between build jobs
of different branches.
Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Reviewed-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-12-31 10:12:05 +00:00
|
|
|
save_good_tree
|