#2 preview.sh: Allow preview.sh keep running for multiple build.sh calls
Merged 5 years ago by asamalik. Opened 5 years ago by otaylor.
fedora-docs/ otaylor/template preview-sh  into  master

file added
+14
@@ -0,0 +1,14 @@ 

+ server {

+     listen       80;

+     server_name  localhost;

+ 

+     location / {

+         root   /antora/public;

+         index  index.html index.htm;

+     }

+ 

+     error_page   500 502 503 504  /50x.html;

+     location = /50x.html {

+         root   /usr/share/nginx/html;

+     }

+ }

file modified
+2 -2
@@ -5,7 +5,7 @@ 

      # Let's assume that the user has the Docker CE installed

      # which doesn't require a root password.

      echo "The preview will be available at http://localhost:8080/"

-     docker run --rm -v $(pwd)/public:/usr/share/nginx/html:ro -p 8080:80 nginx

+     docker run --rm -v $(pwd):/antora:ro -p 8080:80 nginx

  

  elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then

      # Running on Linux.
@@ -14,5 +14,5 @@ 

      echo ""

      echo "This build script is using Docker to run the build in an isolated environment. You might be asked for a root password in order to start it."

      echo "The preview will be available at http://localhost:8080/"

-     sudo docker run --rm -v $(pwd)/public:/usr/share/nginx/html:ro -p 8080:80 nginx

+     sudo docker run --rm -v $(pwd):/antora:ro,z -v $(pwd)/nginx.conf:/etc/nginx/conf.d/default.conf:ro,z -p 8080:80 nginx

  fi

antora deletes and recreates public/ every time the docs are rebuilt;
mounting public/ directly meant that when build.sh, the existing nginx
container didn't see the new docs. Instead of mounting public/ directly
into the nginx default webroot, mount the parent directory at /antora,
and install a tiny nginx configuration file to point the webroot at the
right place.

Pull-Request has been merged by asamalik

5 years ago
Metadata