1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-01-18 04:58:51 +02:00

Build contributing documentation on Travis CI.

Building the contributing document has some special requirements because it runs Docker in Docker so the repo path must align on the host and all Docker containers.  Run `pgbackrest/doc/doc.pl` from within the home directory of the user that will do the doc build, e.g. `home/vagrant`.  If the repo is not located directly in the home directory, e.g. `/home/vagrant/pgbackrest`, then a symlink may be used, e.g. `ln -s /path/to/repo /home/vagrant/pgbackrest`.

Mount the repo in the Vagrantfile at /home/vagrant/pgbackrest but provide a link from the old location at /backrest to make the transition less painful.
This commit is contained in:
David Steele 2020-03-21 18:45:58 -04:00
parent ee2e15bf55
commit 56fb399373
4 changed files with 25 additions and 7 deletions

View File

@ -112,8 +112,15 @@
<render type="markdown">
<render-source key="index" file="../../../README.md"/>
<render-source key="coding" file="../../../CODING.md"/>
<!-- This needs to be uncommented when generating the contributing doc. We are currently unable to get Docker in Docker running correctly in CI. Note that a symlink must be created from /home/[test-user]/pgbackrest to /backrest. -->
<!-- <render-source key="contributing" file="../../../CONTRIBUTING.md"/> -->
<!--
Building the contributing document has some special requirements because it runs Docker in Docker so the repo path
must align on the host and all Docker containers. Run `pgbackrest/doc/doc.pl` from within the home directory of
the user that will do the doc build, e.g. `home/vagrant`. If the repo is not located directly in the home
directory, e.g. `/home/vagrant/pgbackrest`, then a symlink may be used,
e.g. `ln -s /path/to/repo /home/vagrant/pgbackrest`.
-->
<render-source key="contributing" file="../../../CONTRIBUTING.md"/>
<render-source key="test" file="../../../test/README.md"/>
<render-source key="documentation" file="../../README.md"/>
</render>

View File

@ -5,6 +5,8 @@
<!-- Variables used by the rest of the script ============================================================================== -->
<variable-list>
<variable key="host-user-id" eval="y">use English; $UID</variable>
<variable key="host-contrib-id">contrib</variable>
<variable key="host-contrib">pgbackrest-dev</variable>
<variable key="host-contrib-user">{[host-user]}</variable>
@ -28,7 +30,7 @@
apt-get install -y sudo ssh curl vim 2>&amp;1
# Add test user with sudo privileges
RUN adduser --disabled-password --gecos "" {[host-user]} &amp;&amp; \
RUN adduser --disabled-password --uid={[host-user-id]} --gecos "" {[host-user]} &amp;&amp; \
echo '%{[host-user]} ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
WORKDIR /home/{[host-user]}
@ -49,7 +51,7 @@
<p>This example is based on <proper>Ubuntu 19.04</proper>, but it should work on many versions of <proper>Debian</proper> and <proper>Ubuntu</proper>.</p>
<host-add id="{[host-contrib-id]}" name="{[host-contrib]}" user="{[host-contrib-user]}" image="{[host-contrib-image]}" os="u19" option="-v /var/run/docker.sock:/var/run/docker.sock -v {[cwd]}/test:{[cwd]}/test" mount="{[host-repo-path]}:/home/{[host-contrib-user]}/pgbackrest"/>
<host-add id="{[host-contrib-id]}" name="{[host-contrib]}" user="{[host-contrib-user]}" image="{[host-contrib-image]}" os="u19" option="-v /var/run/docker.sock:/var/run/docker.sock -v {[cwd]}/test:{[cwd]}/test" mount="/home/{[host-contrib-user]}/pgbackrest:/home/{[host-contrib-user]}/pgbackrest"/>
<execute-list host="{[host-contrib]}">
<title>Install development tools</title>
@ -104,7 +106,7 @@
<execute-list host="{[host-contrib]}">
<title>Clone <backrest/> repository</title>
<execute err-suppress="y">
<execute skip="y">
<exe-cmd>
git clone https://github.com/pgbackrest/pgbackrest.git
</exe-cmd>

8
test/Vagrantfile vendored
View File

@ -86,6 +86,10 @@ Vagrant.configure(2) do |config|
echo '/tmp/pgbackrest owned by root so tests do not use it' && date
mkdir -p 700 /tmp/pgbackrest
#---------------------------------------------------------------------------------------------------------------------------
echo 'create link to repo in old location to make the transition less painful' && date
ln -s /home/vagrant/pgbackrest /backrest
#---------------------------------------------------------------------------------------------------------------------------
# echo 'Install TeX Live' && date
# Not installed by default since latex is only needed for releases and PDF development/testing
@ -110,6 +114,6 @@ Vagrant.configure(2) do |config|
# Don't share the default vagrant folder
config.vm.synced_folder ".", "/vagrant", disabled: true
# Mount backrest path for testing
config.vm.synced_folder "..", "/backrest"
# Mount pgbackrest path for testing
config.vm.synced_folder "..", "/home/vagrant/pgbackrest"
end

View File

@ -25,6 +25,7 @@ use lib dirname(dirname($0)) . '/doc/lib';
use pgBackRestDoc::Common::Exception;
use pgBackRestDoc::Common::Log;
use pgBackRestDoc::ProjectInfo;
use pgBackRestTest::Common::ContainerTest;
use pgBackRestTest::Common::ExecuteTest;
@ -162,6 +163,10 @@ eval
processExec('sudo rm /etc/sudoers.d/travis');
processEnd();
processBegin('create link from home to repo for contributing doc');
processExec("ln -s ${strBackRestBase} \${HOME?}/" . PROJECT_EXE);
processEnd();
processBegin('release documentation');
processExec("${strReleaseExe} --build --no-gen --vm=${strVm}", {bShowOutputAsync => true, bOutLogOnError => false});
processEnd();