Skip to content

Commit 9cf556d

Browse files
committed
Merge branch 'feature/migrate_adf_docs_to_esp_docs' into 'master'
feature: Migrate esp-adf docs to esp-docs See merge request adf/esp-adf-internal!1333
2 parents 35c629e + 5aa1589 commit 9cf556d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+714
-660
lines changed

.gitlab-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
stages:
22
- pre_check
33
- build
4-
- assign_test
54
- target_test
65
- deploy
6+
- post_deploy
77

88
variables:
99
# System environment

.gitlab/ci/docs.yml

Lines changed: 132 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
.if-label-build_docs: &if-label-build_docs
2727
if: '$BOT_LABEL_BUILD_DOCS || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*build_docs(?:,[^,\n\r]+)*$/i'
2828

29+
.if-label-docs_full: &if-label-docs_full
30+
if: '$BOT_LABEL_DOCS_FULL || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*docs_full(?:,[^,\n\r]+)*$/i'
31+
2932
.doc-rules:build:docs:
3033
rules:
3134
- <<: *if-protected
@@ -34,39 +37,139 @@
3437
when: never
3538
- <<: *if-label-build_docs
3639

37-
build_docs:
40+
.doc-rules:deploy:docs_production:
41+
rules:
42+
- <<: *if-protected
43+
44+
.before_script_install_requirements:
3845
stage: build
39-
extends:
40-
- .doc-rules:build:docs
41-
image: $CI_DOCKER_REGISTRY/esp-idf-doc-env:v7
46+
image: "$CI_DOCKER_REGISTRY/esp-idf-doc-env-v5.0:4-4"
4247
tags:
4348
- build_docs
49+
variables:
50+
DOCS_DIR: $CI_PROJECT_DIR/docs
51+
IDF_VERSION_TAG: "v5.0"
52+
IDF_TAG_FLAG: "true"
53+
dependencies: []
54+
55+
.build_docs_html_template:
56+
extends:
57+
- .before_script_install_requirements
58+
variables:
59+
DOC_BUILDERS: "html"
60+
script:
61+
- pip install -r docs/requirements.txt
62+
- cd $DOCS_DIR
63+
- mkdir -p $ADF_PATH/docs/_build/${DOCLANG}/generic/inc
64+
- build-docs -bs $DOC_BUILDERS -l $DOCLANG build
65+
- ./check_lang_folder_sync.sh
66+
- echo "ESP-ADF Guide preview available at $CI_JOB_URL/artifacts/file/docs/_build/$DOCLANG/generic/html/index.html"
67+
68+
.build_docs_pdf_template:
69+
extends:
70+
- .before_script_install_requirements
71+
script:
72+
- pip install -r docs/requirements.txt
73+
- cd $DOCS_DIR
74+
- mkdir -p $ADF_PATH/docs/_build/${DOCLANG}/generic/inc
75+
- build-docs --skip-reqs-check -l $DOCLANG -bs latex
76+
77+
build_docs_html:
78+
extends:
79+
- .build_docs_html_template
80+
- .doc-rules:build:docs
4481
artifacts:
4582
when: always
4683
paths:
47-
# English version of documentation
48-
- docs/en/doxygen-warning-log.txt
49-
- docs/en/sphinx-warning-log.txt
50-
- docs/en/sphinx-warning-log-sanitized.txt
51-
- docs/en/_build/html
52-
# Chinese version of documentation
53-
- docs/zh_CN/doxygen-warning-log.txt
54-
- docs/zh_CN/sphinx-warning-log.txt
55-
- docs/zh_CN/sphinx-warning-log-sanitized.txt
56-
- docs/zh_CN/_build/html
57-
expire_in: 1 mos
84+
- $DOCS_DIR/_build/*/*/*.txt
85+
- $DOCS_DIR/_build/*/*/html/*
86+
expire_in: 4 days
87+
parallel:
88+
matrix:
89+
- DOCLANG: "en"
90+
- DOCLANG: "zh_CN"
91+
92+
build_docs_pdf:
93+
extends:
94+
- .build_docs_pdf_template
95+
- .doc-rules:build:docs
96+
artifacts:
97+
when: always
98+
paths:
99+
- $DOCS_DIR/_build/*/*/latex/*
100+
- $DOCS_DIR/_build/*/*/*.txt
101+
expire_in: 4 days
102+
parallel:
103+
matrix:
104+
- DOCLANG: "en"
105+
- DOCLANG: "zh_CN"
106+
107+
.deploy_docs_template:
108+
stage: test_deploy
109+
image: "$CI_DOCKER_REGISTRY/esp-idf-doc-env-v5.0"
110+
variables:
111+
DOCS_BUILD_DIR: "${CI_PROJECT_DIR}/docs/_build/"
112+
PYTHONUNBUFFERED: 1
113+
tags:
114+
- deploy
115+
- shiny
116+
needs:
117+
- job: "build_docs_html"
118+
artifacts: true
119+
optional: true
120+
- job: "build_docs_pdf"
121+
artifacts: true
122+
optional: true
58123
script:
59-
- source /opt/pyenv/activate && pyenv global 3.6.10
60-
- pip install "setuptools<57.5.0"
61-
- pip install "funcparserlib==0.3.6"
62-
- /opt/pyenv/pyenv-1.2.16/versions/3.6.10/bin/python -m pip install --user -r $ADF_PATH/docs/requirements.txt
63-
- cd docs
64-
- ./check_lang_folder_sync.sh
65-
- cd en
66-
- make gh-linkcheck
67-
- make html
68-
- ../check_doc_warnings.sh
69-
- cd ../zh_CN
70-
- make gh-linkcheck
71-
- make html
72-
- ../check_doc_warnings.sh
124+
- source ${CI_PROJECT_DIR}/tools/ci/utils.sh
125+
- add_doc_server_ssh_keys $DOCS_DEPLOY_PRIVATEKEY $DOCS_DEPLOY_SERVER $DOCS_DEPLOY_SERVER_USER
126+
- export GIT_VER=$(git describe --always ${PIPELINE_COMMIT_SHA} --)
127+
- deploy-docs
128+
129+
# stage: test_deploy
130+
.deploy_docs_preview:
131+
extends:
132+
- .deploy_docs_template
133+
rules:
134+
- <<: *if-merge_request_event
135+
- <<: *if-open-merge-request
136+
when: never
137+
- <<: *if-dev-push
138+
when: never
139+
- <<: *if-label-build_docs
140+
- <<: *if-label-docs_full
141+
changes: *patterns-docs-preview
142+
variables:
143+
TYPE: "preview"
144+
# older branches use DOCS_DEPLOY_KEY, DOCS_SERVER, DOCS_SERVER_USER, DOCS_PATH for preview server so we keep these names for 'preview'
145+
DOCS_DEPLOY_PRIVATEKEY: "$DOCS_DEPLOY_KEY"
146+
DOCS_DEPLOY_SERVER: "$DOCS_SERVER"
147+
DOCS_DEPLOY_SERVER_USER: "$DOCS_SERVER_USER"
148+
DOCS_DEPLOY_PATH: "$DOCS_PATH"
149+
DOCS_DEPLOY_URL_BASE: "https://$DOCS_PREVIEW_SERVER_URL/docs/esp-adf"
150+
151+
# stage: post_deploy
152+
deploy_docs_production:
153+
# The DOCS_PROD_* variables used by this job are "Protected" so these branches must all be marked "Protected" in Gitlab settings
154+
extends:
155+
- .deploy_docs_template
156+
- .doc-rules:deploy:docs_production
157+
stage: post_deploy
158+
dependencies: # set dependencies to null to avoid missing artifacts issue
159+
needs: # ensure runs after push_to_github succeeded
160+
- job: "build_docs_html"
161+
artifacts: true
162+
optional: true
163+
- job: "build_docs_pdf"
164+
artifacts: true
165+
optional: true
166+
- job: push_to_github
167+
artifacts: false
168+
variables:
169+
TYPE: "preview"
170+
DOCS_DEPLOY_PRIVATEKEY: "$DOCS_PROD_DEPLOY_KEY"
171+
DOCS_DEPLOY_SERVER: "$DOCS_PROD_SERVER"
172+
DOCS_DEPLOY_SERVER_USER: "$DOCS_PROD_SERVER_USER"
173+
DOCS_DEPLOY_PATH: "$DOCS_PROD_PATH"
174+
DOCS_DEPLOY_URL_BASE: "https://docs.espressif.com/projects/esp-adf"
175+
DEPLOY_STABLE: 1

0 commit comments

Comments
 (0)