From b863683f0fb843f3b498c63622bca08b71335c00 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Fri, 4 Sep 2020 18:07:21 -0400 Subject: [PATCH] LP#1848524: tweaks to generate_docs.pl - make executable - adjust so that it doesn't need root privileges to install in the system Node module directory - let Gulp be installed in the temporary scratch directory Signed-off-by: Galen Charlton --- docs/generate_docs.pl | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) mode change 100644 => 100755 docs/generate_docs.pl diff --git a/docs/generate_docs.pl b/docs/generate_docs.pl old mode 100644 new mode 100755 index 0ca827272e..e255141b59 --- a/docs/generate_docs.pl +++ b/docs/generate_docs.pl @@ -90,9 +90,11 @@ mkdir "$tmp_space/staging/"; # Deal with ui repo exec_system_cmd("git clone $antoraui_git $tmp_space/antora-ui"); +exec_system_cmd("cd $tmp_space/antora-ui && npm install gulp-cli"); + exec_system_cmd("cd $tmp_space/antora-ui && npm install"); -exec_system_cmd("cd $tmp_space/antora-ui && gulp build && gulp pack"); +exec_system_cmd("cd $tmp_space/antora-ui && $tmp_space/antora-ui/node_modules/.bin/gulp build && $tmp_space/antora-ui/node_modules/.bin/gulp pack"); # Deal with root URL Antora configuration rewrite_yml($base_url,"site/url","site.yml"); @@ -108,15 +110,15 @@ exec_system_cmd('ansible-playbook setup_lunr.yml'); exec_system_cmd('npm i antora-lunr'); # Install the antora site generator with lunr -exec_system_cmd('npm i -g antora-site-generator-lunr'); +exec_system_cmd('npm i antora-site-generator-lunr'); # Now, finally, let's build antora -exec_system_cmd('DOCSEARCH_ENABLED=true DOCSEARCH_ENGINE=lunr NODE_PATH="$(npm -g root)" antora --generator antora-site-generator-lunr site.yml'); +exec_system_cmd('DOCSEARCH_ENABLED=true DOCSEARCH_ENGINE=lunr NODE_PATH="$(npm root)" ./node_modules/@antora/cli/bin/antora --generator antora-site-generator-lunr site.yml'); # rsync to production exec_system_cmd('rsync -av --delete '.$tmp_space.'/staging/* '.$html_output.'/'); -print "Success: your site should be vieaable here: $base_url\n"; +print "Success: your site should be viewable here: $base_url\n"; sub rewrite_yml { @@ -230,4 +232,4 @@ sub read_file return \@lines; } -exit; \ No newline at end of file +exit; -- 2.11.0