LP#1848524: tweaks to generate_docs.pl
authorGalen Charlton <gmc@equinoxinitiative.org>
Fri, 4 Sep 2020 22:07:21 +0000 (18:07 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Fri, 4 Sep 2020 22:07:21 +0000 (18:07 -0400)
- 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 <gmc@equinoxinitiative.org>
docs/generate_docs.pl [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 0ca8272..e255141
@@ -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;