Skip to content

Commit

Permalink
k230 canmv docs release v0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
wuwentao committed Nov 24, 2023
1 parent 1cdf78c commit cbc0028
Show file tree
Hide file tree
Showing 123 changed files with 14,709 additions and 161 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
_build
venv
*.pyc
_templates/layout.html

31 changes: 29 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ markdown-link-check:
- uname -a
- whoami
- pwd
- find . -name \*.md -print0 | xargs -0 -n1 markdown-link-check -q
#- find . -name \*.md -print0 | xargs -0 -n1 markdown-link-check -q
- git fetch
- git diff origin/dev --name-only -z
- git diff origin/dev --name-only -z | (grep "\\.md$" || echo zh/CanMV-K230常见问题解答.md) | xargs markdown-link-check

# new MR open
markdownlint:
Expand All @@ -76,7 +79,10 @@ markdownlint:
- whoami
- pwd
#- markdownlint-cli2 *.md **/*.md **/**/*.md **/**/**/*.md **/**/**/**/*.md
- find . -name \*.md -print0 | xargs -0 markdownlint-cli2
#- find . -name \*.md -print0 | xargs -0 markdownlint-cli2
- git fetch
- git diff origin/dev --name-only -z
- git diff origin/dev --name-only -z | (grep "\\.md$" || echo zh/CanMV-K230常见问题解答.md) | xargs markdownlint-cli2

.setup_env:
before_script:
Expand Down Expand Up @@ -137,3 +143,24 @@ markdownlint:
- echo "---push to github---"
- git push --atomic --tags -u -f github main || git push --atomic --tags -u -f github main || git push --atomic --tags -u -f github main

build-web-docs:
stage: build
rules:
- if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "dev"
image: ai.b-bug.org:5000/python:web-docs
tags:
- k230
environment:
name: dev
url: https://ai.b-bug.org/k230/k230_canmv_docs/dev/
script:
- git fetch
- git checkout dev
- git pull
- python3 preprocess.py
- git config --global user.email "auto@canaan-creative.com"
- git config --global user.name "GitLab CI"
- git commit "*.md" -m "remove cover"
- make mhtml
- rm -rf /data1/k230/k230_canmv_docs/*
- cp -r _build/* /data1/k230/k230_canmv_docs
31 changes: 31 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SPHINXMULTIVERSION ?= sphinx-multiversion
SOURCEDIR = .
BUILDDIR = _build
WEB_DOCS_BUILDER_USER ?= gitlab+deploy-token-8
WEB_DOCS_BUILDER_TOKEN ?= _qsc99tPFsbcBhSbXH4S

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile _templates/layout.html
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

mhtml: _templates/layout.html
@$(SPHINXMULTIVERSION) "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

_templates/layout.html:
git clone --depth 1 https://$(WEB_DOCS_BUILDER_USER):$(WEB_DOCS_BUILDER_TOKEN)@g.a-bug.org/huangziyi/web-docs-builder.git
cp web-docs-builder/layout.html _templates/layout.html
rm -rf web-docs-builder
9 changes: 9 additions & 0 deletions _static/img/ch-flag.a61145a4.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit cbc0028

Please sign in to comment.