2018-12-12 20:52:23 +02:00
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE doc SYSTEM "doc.dtd">
<doc title= "{[project]}" subtitle= "Building Documentation" toc= "y" >
<description > Building {[project]} Documentation</description>
<section id= "general" >
<title > General Builds</title>
<p > The <backrest /> documentation can output a variety of formats and target several platforms and <postgres /> versions.</p>
<p > This will build all documentation with defaults:</p>
<code-block type= "bash" >
./doc.pl
</code-block>
2021-10-28 21:15:49 +02:00
<p > The user guide can be built for <id > rhel</id> and <id > debian</id> . This will build the HTML user guide for RHEL:</p>
2018-12-12 20:52:23 +02:00
<code-block type= "bash" >
2021-05-24 22:03:15 +02:00
./doc.pl --out=html --include=user-guide --var=os-type=rhel
2018-12-12 20:52:23 +02:00
</code-block>
<p > Documentation generation will build a cache of all executed statements and use the cache to build the documentation quickly if no executed statements have changed. This makes proofing text-only edits very fast, but sometimes it is useful to do a full build without using the cache:</p>
<code-block type= "bash" >
2021-05-24 22:03:15 +02:00
./doc.pl --out=html --include=user-guide --var=os-type=rhel --no-cache
2018-12-12 20:52:23 +02:00
</code-block>
2021-05-24 22:03:15 +02:00
<p > Each <id > os-type</id> has a default container image that will be used as a base for creating hosts but it may be useful to change the image.</p>
2018-12-12 20:52:23 +02:00
<code-block type= "bash" >
./doc.pl --out=html --include=user-guide --var=os-type=debian --var=os-image=debian:9
2021-05-24 22:03:15 +02:00
./doc.pl --out=html --include=user-guide --var=os-type=rhel --var=os-image=centos:7
2018-12-12 20:52:23 +02:00
</code-block>
2019-01-30 16:53:59 +02:00
2021-10-28 21:15:49 +02:00
<p > The following is a sample RHEL 7 configuration that can be used for building the documentation.</p>
2019-01-30 16:53:59 +02:00
<code-block type= "bash" >
# Install docker
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install -y docker-ce
sudo systemctl start docker
# Install tools
sudo yum install -y git wget
2019-01-30 21:11:52 +02:00
# Install latex (for building PDF)
sudo yum install -y texlive texlive-titlesec texlive-sectsty texlive-framed texlive-epstopdf ghostscript
2021-10-28 21:15:49 +02:00
# Install Perl modules via CPAN that do not have packages
2019-01-30 16:53:59 +02:00
sudo yum install -y yum cpanminus
sudo yum groupinstall -y "Development Tools" "Development Libraries"
sudo cpanm install --force XML::Checker::Parser
# Add documentation test user
sudo groupadd test
sudo adduser -gtest -n testdoc
sudo usermod -aG docker testdoc
</code-block>
2018-12-12 20:52:23 +02:00
</section>
<section id= "package" >
<title > Building with Packages</title>
<p > A user-specified package can be used when building the documentation. Since the documentation exercises most <backrest /> functionality this is a great way to smoke-test packages.</p>
<p > The package must be located within the <backrest /> repo and the specified path should be relative to the repository base. <path > test/package</path> is a good default path to use.</p>
<p > Ubuntu 16.04:</p>
<code-block type= "bash" >
./doc.pl --out=html --include=user-guide --no-cache --var=os-type=debian --var=os-image=ubuntu:16.04 --var=package=test/package/pgbackrest_2.08-0_amd64.deb
</code-block>
2021-10-28 21:15:49 +02:00
<p > RHEL 7:</p>
2018-12-12 20:52:23 +02:00
<code-block type= "bash" >
2021-05-24 22:03:15 +02:00
./doc.pl --out=html --include=user-guide --no-cache --var=os-type=rhel --var=os-image=centos:7 --var=package=test/package/pgbackrest-2.08-1.el7.x86_64.rpm
2018-12-12 20:52:23 +02:00
</code-block>
2021-10-28 21:15:49 +02:00
<p > RHEL 8:</p>
2020-12-04 17:59:57 +02:00
<code-block type= "bash" >
2021-05-24 22:03:15 +02:00
./doc.pl --out=html --include=user-guide --no-cache --var=os-type=rhel --var=os-image=centos:8 --var=package=test/package/pgbackrest-2.08-1.el8.x86_64.rpm
2020-12-04 17:59:57 +02:00
</code-block>
2019-01-30 16:53:59 +02:00
<p > Packages can be built with <file > test.pl</file> using the following configuration on top of the configuration given for building the documentation.</p>
<code-block type= "bash" >
# Install recent git
sudo yum remove -y git
sudo yum install -y https://centos7.iuscommunity.org/ius-release.rpm
sudo yum install -y git2u-all
# Install Perl modules
sudo yum install -y perl-ExtUtils-ParseXS perl-ExtUtils-Embed perl-ExtUtils-MakeMaker perl-YAML-LibYAML
# Install dev libraries
2019-01-30 22:02:42 +02:00
sudo yum install -y libxml2-devel openssl-devel
2019-01-30 16:53:59 +02:00
# Add test user with sudo privileges
sudo adduser -gtest -n test
sudo usermod -aG docker test
sudo chmod 750 /home/test
sudo echo 'test ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/pgbackrest
# Add pgbackrest user required by tests
sudo adduser -gtest -n pgbackrest
</code-block>
2018-12-12 20:52:23 +02:00
</section>
</doc>