Commit 58e313e4 authored by Yunus Sevinchan's avatar Yunus Sevinchan
Browse files

Merge branch...

Merge branch '351-deploy-docs-directly-from-this-repo-not-by-triggering-an-external-repo' into 'master'

Deploy docs directly & fix linkcheck

Closes #351

See merge request !282
parents 5d64280a d92fd15d
Loading
Loading
Loading
Loading
Loading
+16 −10
Original line number Diff line number Diff line
@@ -522,9 +522,7 @@ docs:build:

    # For testing, do not generate figures again
    - make sphinx_doctest
    - make sphinx_linkcheck || true
    # NOTE linkcheck is not set to fail because there are some links that will
    #      always lead to a failure (the relative doxygen links for instance)
    - make sphinx_linkcheck
  after_script:
    # Append the error log such that it's more convenient to read in the CI log
    - echo "-------- Errors emitted during building of documentation --------"
@@ -544,8 +542,8 @@ docs:build:
# Deploy ...
#   - a documentation review environment, which is meant to *always* be created
#     even if the build:docs job failed with allow_failure set.
#   - the documentation by triggering a pipeline in the docs project, which has
#     the docs.utopia-project.org domain registered with GitLab Pages
#   - the production-level documentation by running a GitLab Pages job, which
#     ends up being served under docs.utopia-project.org
#   - the latest Utopia docker image to Docker Hub: ccees/utopia:latest


@@ -565,8 +563,8 @@ deploy:docs_review:
    url: $PAGES_URL/-/jobs/$CI_JOB_ID/artifacts/build/doc/html/index.html


deploy:docs_gitlab_pages:
  image: curlimages/curl:latest
pages:
  image: alpine
  stage: deploy
  rules:
    - if: '$DEPLOY_DOCS == "true"'
@@ -575,10 +573,18 @@ deploy:docs_gitlab_pages:
      when: always
    - when: never
  needs:
    - job: docs:build
      artifacts: false
    - docs:build
  script:
    - curl -X POST -F token=$DOC_DEPLOYMENT_TRIGGER_TOKEN -F ref=master https://gitlab.com/api/v4/projects/25960923/trigger/pipeline
    # Copy files into public directory which is then exposed as GitLab Pages
    - cd $CI_PROJECT_DIR
    - mkdir public
    - mv build/doc/doxygen    public/doxygen
    - mv build/doc/html       public/html
    - cp doc/_redirects       public/_redirects
    # see: https://docs.gitlab.com/ee/user/project/pages/redirects.html#create-redirects
  artifacts:
    paths:
      - public
  environment:
    name: production/docs
    url: https://docs.utopia-project.org/
+8 −1
Original line number Diff line number Diff line
@@ -4,6 +4,10 @@
# required for using the latest Utopia.
#
function(register_models_with_frontend)
    #
    # NOTE If changing something here, also check the doc/dev/versioning.rst
    #      file, making sure that the instructions match each other.
    #
    message(FATAL_ERROR
        "It looks like you have updated Utopia.\n"
        "This error is to inform you about the changes needed to get your "
@@ -29,7 +33,10 @@ function(register_models_with_frontend)
        "where this error message comes) to the updated function name "
        "`register_models_with_utopya`. After having done that, this error "
        "message will no longer appear.\n"
        "3) Run `cmake ..` again.\n"
        "3) Remove the CMake cache file (`build/CMakeCache.txt`) in your "
        "models repository or remove your whole `build` directory to avoid "
        "carrying over outdated variables.\n"
        "4) Run `cmake ..` in your models repository.\n"
        "This should get your project running again with the latest version "
        "of Utopia. However, there may be further steps necessary to update "
        "your model plots and tests. "
+2 −2
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@ set(SHARED_SPHINX_ARGS
        ${CMAKE_CURRENT_SOURCE_DIR}                 # input dir
        ${CMAKE_CURRENT_BINARY_DIR}/html            # output dir
)
set(SPHINX_FAIL_ON_WARN -W --keep-going)
set(SPHINX_FAIL_ON_WARN -W --keep-going)            # fail on warnings

# Register sphinx build targets
add_custom_target(sphinx_html
@@ -56,7 +56,7 @@ add_custom_target(sphinx_doctest
)
add_custom_target(sphinx_linkcheck
    COMMAND ${RUN_IN_UTOPIA_ENV}
        sphinx-build -T -b linkcheck ${SHARED_SPHINX_ARGS}
        sphinx-build -T -b linkcheck ${SHARED_SPHINX_ARGS} ${SPHINX_FAIL_ON_WARN}
)

# Add the doxygen-dependent documentation target only when it exists

doc/_redirects

0 → 100644
+6 −0
Original line number Diff line number Diff line
/                       /html/index.html 301
/index.html             /html/index.html 301

/utopia                 /utopia/html/index.html 301
/utopia/                /utopia/html/index.html 301
/utopia/index.html      /utopia/html/index.html 301
+1 −1
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@ Below is a brief history of how the Utopia project came about.

2016
^^^^
The idea of the Utopia framework emerged in 2016 among members of the `TS-CCEES research group <https://ts.iup.uni-heidelberg.de/>`_ at the `Institute of Environmental Physics <https://iup.uni-heidelberg.de/en/>`_.
The idea of the Utopia framework emerged in 2016 among members of the `TS-CCEES research group <http://ts.iup.uni-heidelberg.de/>`_ at the `Institute of Environmental Physics <https://www.iup.uni-heidelberg.de/en>`_.
In the words of Prof. Kurt Roth at that time:

.. pull-quote::
Loading