[tor-commits] [sbws/m12] fix: CI: Build docs automatically in Gitlab

juga at torproject.org juga at torproject.org
Tue May 25 13:15:05 UTC 2021


commit 2944ddd3e36c904f11f54af7672c65daa1c00556
Author: juga0 <juga at riseup.net>
Date:   Tue Apr 20 11:02:21 2021 +0000

    fix: CI: Build docs automatically in Gitlab
    
    also replace the links to Read the Docs to pages.torproject.net
    and add redirect to it.
    
    Closes: #40085.
---
 .gitlab-ci.yml               | 10 ++++++++++
 README.rst                   | 10 +++++-----
 docs/source/index.rst        | 13 +++++++++++++
 docs/source/man_sbws.ini.rst |  2 +-
 docs/source/man_sbws.rst     |  2 +-
 5 files changed, 30 insertions(+), 7 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 1a9ad10..3708fbf 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -148,3 +148,13 @@ release_job:
     ref: "$CI_COMMIT_TAG"
     milestones:
       - "sbws: 1.1.x-final"
+
+pages:
+  stage: deploy
+  before_script:
+    - pip install .[doc]
+  script:
+    - cd docs && sphinx-build source ../public
+  artifacts:
+    paths:
+      - public
diff --git a/README.rst b/README.rst
index 8849cac..4fc2ba2 100644
--- a/README.rst
+++ b/README.rst
@@ -23,10 +23,10 @@ authorities on the public Tor network. Please do not run this software
 on the public Tor network unless you are one of the Tor bandwidth
 authorities, to avoid creating unnecessary traffic.
 
-**ADVICE**: It is recommended to read this documentation at `Read the
-Docs <https://sbws.rtfd.io>`__. In `Tor Project
-Gitlab <https://gitlab.torproject.org/tpo/network-health/sbws>`__ (tpo
-Gitlab) some links won’t be properly rendered. It can also be read after
+**ADVICE**: It is recommended to read this documentation at
+https://tpo.pages.torproject.net/network-health/sbws.
+At https://gitlab.torproject.org/tpo/network-health/sbws
+some links won’t be properly rendered. It can also be read after
 installing the Debian package ``sbws-doc`` in ``/usr/share/doc/sbws`` or
 after building it locally as explained in
 ``./docs/source/documenting.rst``.
@@ -54,7 +54,7 @@ Documentation
 -------------
 
 More extensive documentation can be found in the ``./docs`` directory,
-and online at `sbws.rtfd.io <https://sbws.readthedocs.io>`__.
+and online at https://tpo.pages.torproject.net/network-health/sbws.
 
 License
 -------
diff --git a/docs/source/index.rst b/docs/source/index.rst
index 85f8591..9baf73d 100644
--- a/docs/source/index.rst
+++ b/docs/source/index.rst
@@ -3,6 +3,19 @@
    You can adapt this file completely to your liking, but it should at least
    contain the root `toctree` directive.
 
+.. raw:: html
+
+  <script type="text/javascript">
+  if (String(window.location).indexOf("readthedocs") !== -1) {
+    window.alert('The documentation has moved, redirecting...');
+    window.location.replace('https://tpo.pages.torproject.net/network-health/sbws');
+  }
+  </script>
+  <noscript>
+    NOTE: documentation has moved from https://sbws.readthedocs.org to
+    https://tpo.pages.torproject.net/network-health/sbws
+  </noscript>
+
 Welcome to Simple Bandwidth Scanner's documentation!
 ====================================================
 
diff --git a/docs/source/man_sbws.ini.rst b/docs/source/man_sbws.ini.rst
index 31effc7..071d31f 100644
--- a/docs/source/man_sbws.ini.rst
+++ b/docs/source/man_sbws.ini.rst
@@ -230,7 +230,7 @@ Any other path to the configuration file can be specified using the
 SEE ALSO
 ---------
 
-**sbws** (1), https://sbws.readthedocs.org.
+**sbws** (1), https://tpo.pages.torproject.net/network-health/sbws.
 
 BUGS
 ----
diff --git a/docs/source/man_sbws.rst b/docs/source/man_sbws.rst
index 3586cef..6a10a6d 100644
--- a/docs/source/man_sbws.rst
+++ b/docs/source/man_sbws.rst
@@ -107,7 +107,7 @@ In the following list, the first path is the default location when running
 SEE ALSO
 ---------
 
-**sbws.ini** (5), https://sbws.readthedocs.org,
+**sbws.ini** (5), https://tpo.pages.torproject.net/network-health/sbws,
 https://gitweb.torproject.org/torspec.git/tree/bandwidth-file-spec.txt,
 **tor** (1).
 





More information about the tor-commits mailing list