diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 19064691e28bc10231ce941cd123b939086ea690..35888673ea31afbbc5455801cc05422c72c023e4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,45 +6,7 @@ stages: pages: stage: deploy script: - - rm -rf public - - sphinx-build -b html . public/latest/ - - sphinx-build -M latexpdf . public/latest/ - - mv public/latest/latex/beagleboard-docs.pdf public/latest/ - - rm -rf public/latest/latex - - echo "/ /latest/ 302" > public/_redirects + - ./gitlab_build.sh artifacts: - name: "latest" paths: - public - rules: - - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - -#pages: -# stage: deploy -# script: -# - sphinx-build -b html . public/$CI_COMMIT_BRANCH/ -# - sphinx-build -M latexpdf . public/$CI_COMMIT_BRANCH/ -# - mv public/$CI_COMMIT_BRANCH/latex/beagleboard-docs.pdf public/$CI_COMMIT_BRANCH/ -# - rm -rf public/$CI_COMMIT_BRANCH/latex -# artifacts: -# name: "$CI_COMMIT_BRANCH" -# paths: -# - public -# rules: -# - if: ($CI_COMMIT_BRANCH && ($CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH)) -# -#pages: -# stage: deploy -# script: -# - export GIT_BRANCH=$(git branch -a --contains tags/$CI_COMMIT_TAG | grep origin | sed 's/.*origin\///') -# - sphinx-build -b html . public/$GIT_BRANCH/ -# - sphinx-build -M latexpdf . public/$GIT_BRANCH/ -# - mv public/$GIT_BRANCH/latex/beagleboard-docs.pdf public/$GIT_BRANCH/beagleboard-docs-$CI_COMMIT_TAG.pdf -# - ln -s public/$GIT_BRANCH/latex/beagleboard-docs-$CI_COMMIT_TAG.pdf public/$GIT_BRANCH/beagleboard-docs.pdf -# - rm -rf public/$GIT_BRANCH/latex -# artifacts: -# name: "$GIT_BRANCH" -# paths: -# - public -# rules: -# - if: $CI_COMMIT_TAG \ No newline at end of file diff --git a/conf.py b/conf.py index f09fb5ec42b5e8032c9d48f503795896cc63602b..6e713339ee35f7a9acea5fdc0049f4e17ed15957 100644 --- a/conf.py +++ b/conf.py @@ -126,6 +126,9 @@ latex_documents = [ vcs_link_version = f"v{version}" if is_release else "main" vcs_link_base_url = f"https://git.beagleboard.org/docs/docs.beagleboard.io/blob/{vcs_link_version}" +#language = 'en' +#locales_dir = ['locale/'] +#gettext_compact = True def setup(app): # theme customizations diff --git a/gitlab-build.sh b/gitlab-build.sh new file mode 100755 index 0000000000000000000000000000000000000000..7890a3d482e4b533b385fbc795ffd8bc3d206148 --- /dev/null +++ b/gitlab-build.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +env + +if [ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]; then + +rm -rf public +sphinx-build -b html . public/latest/ +sphinx-build -M latexpdf . public/latest/ +mv public/latest/latex/beagleboard-docs.pdf public/latest/ +rm -rf public/latest/latex +cat <<HERE > public/index.html +<!DOCTYPE html> +<html> + <head> + <meta http-equiv="refresh" content="7; url='https://www.w3docs.com'" /> + </head> + <body> + <p>Please follow <a href="https://www.w3docs.com">this link</a>.</p> + </body> +</html> +HERE + +elif [ "$CI_COMMIT_BRANCH" != "" ]; then + +sphinx-build -b html . public/$CI_COMMIT_BRANCH/ +sphinx-build -M latexpdf . public/$CI_COMMIT_BRANCH/ +mv public/$CI_COMMIT_BRANCH/latex/beagleboard-docs.pdf public/$CI_COMMIT_BRANCH/ +rm -rf public/$CI_COMMIT_BRANCH/latex + +elif [ "$CI_COMMIT_TAG" != "" ]; then + +export GIT_BRANCH=$(git branch -a --contains tags/$CI_COMMIT_TAG | grep origin | sed 's/.*origin\///') +sphinx-build -b html . public/$GIT_BRANCH/ +sphinx-build -M latexpdf . public/$GIT_BRANCH/ +mv public/$GIT_BRANCH/latex/beagleboard-docs.pdf public/$GIT_BRANCH/beagleboard-docs-$CI_COMMIT_TAG.pdf +ln -s public/$GIT_BRANCH/latex/beagleboard-docs-$CI_COMMIT_TAG.pdf public/$GIT_BRANCH/beagleboard-docs.pdf +rm -rf public/$GIT_BRANCH/latex + +fi +