Skip to content

Commit

Permalink
build documentation in the background
Browse files Browse the repository at this point in the history
  • Loading branch information
RussTedrake committed Jan 24, 2025
1 parent fdb1f5d commit 4f1a1e9
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions book/update.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,31 @@ use strict;
use warnings;

use CGI;
my $r = new CGI;
my $r = CGI->new;

print $r->header();
print "<p>pulling repo...<br/>";
system 'git fetch origin && git reset --hard origin/master';
system 'git submodule update --init --recursive';
print "<br/>done.</p>";

print "<p>building documentation...<br/>";
print "<p>building documentation in the background...<br/>";
chdir "..";

my $status = system('/bin/bash', '-c', '
source venv/bin/activate &&
poetry install --only docs &&
sphinx-build -M html underactuated /tmp/underactuated_doc &&
rm -rf book/python &&
cp -r /tmp/underactuated_doc/html book/python
');
my $status = system(
'nohup', '/bin/bash', '-c', '
source venv/bin/activate &&
poetry install --only docs &&
sphinx-build -M html underactuated /tmp/underactuated_doc &&
rm -rf book/python &&
cp -r /tmp/underactuated_doc/html book/python
> /tmp/underactuated_build_docs.log 2>&1', '&'
);

if ($status == 0) {
print "<br/>done.</p>";
print "<br/>Documentation build started in the background. Check /tmp/underactuated_build_docs.log for progress.</p>";
} else {
print "<br/>Error occurred: $status</p>";
print "<br/>Error occurred while starting the build process: $status</p>";
}

print $r->end_html;

0 comments on commit 4f1a1e9

Please sign in to comment.