Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Commit 7c3717bb authored by Jason Kridner's avatar Jason Kridner
Browse files

CI: add CI build script

parent 72c2d871
Branches
Tags
No related merge requests found
......@@ -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
......@@ -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
......
#!/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
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment