2023-03-06 22:06:13 -05:00
|
|
|
.patterns-docs-full: &patterns-docs-full
|
2021-04-27 00:24:22 -04:00
|
|
|
- ".gitlab/ci/docs.yml"
|
|
|
|
- "docs/**/*"
|
2023-03-06 22:06:13 -05:00
|
|
|
- "**/*.rst"
|
|
|
|
- "CONTRIBUTING.rst"
|
2023-04-11 01:11:57 -04:00
|
|
|
- "**/soc_caps.h"
|
2023-03-06 22:06:13 -05:00
|
|
|
|
|
|
|
.patterns-docs-partial: &patterns-docs-partial
|
2021-04-27 00:24:22 -04:00
|
|
|
- "components/**/*.h"
|
|
|
|
- "components/**/Kconfig*"
|
|
|
|
- "components/**/CMakeList.txt"
|
|
|
|
- "components/**/sdkconfig*"
|
2022-08-30 11:11:19 -04:00
|
|
|
- "tools/tools.json"
|
|
|
|
- "tools/idf_tools.py"
|
2023-03-06 22:06:13 -05:00
|
|
|
|
|
|
|
.patterns-example-readme: &patterns-example-readme
|
|
|
|
- "examples/**/*.md"
|
2021-04-27 00:24:22 -04:00
|
|
|
|
2021-10-13 06:19:05 -04:00
|
|
|
.patterns-docs-preview: &patterns-docs-preview
|
|
|
|
- "docs/**/*"
|
|
|
|
|
2021-04-27 00:24:22 -04:00
|
|
|
.if-protected: &if-protected
|
|
|
|
if: '($CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_BRANCH =~ /^release\/v/ || $CI_COMMIT_TAG =~ /^v\d+\.\d+(\.\d+)?($|-)/)'
|
|
|
|
|
|
|
|
.if-protected-no_label: &if-protected-no_label
|
|
|
|
if: '($CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_BRANCH =~ /^release\/v/ || $CI_COMMIT_TAG =~ /^v\d+\.\d+(\.\d+)?($|-)/) && $BOT_TRIGGER_WITH_LABEL == null'
|
|
|
|
|
2023-10-18 00:55:53 -04:00
|
|
|
.if-qa-test-tag: &if-qa-test-tag
|
|
|
|
if: '$CI_COMMIT_TAG =~ /^qa-test/'
|
|
|
|
|
2021-04-27 00:24:22 -04:00
|
|
|
.if-label-build_docs: &if-label-build_docs
|
|
|
|
if: '$BOT_LABEL_BUILD_DOCS || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*build_docs(?:,[^,\n\r]+)*$/i'
|
|
|
|
|
2023-03-06 22:06:13 -05:00
|
|
|
.if-label-docs_full: &if-label-docs_full
|
|
|
|
if: '$BOT_LABEL_DOCS_FULL || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*docs_full(?:,[^,\n\r]+)*$/i'
|
2021-04-27 00:24:22 -04:00
|
|
|
|
|
|
|
.if-dev-push: &if-dev-push
|
2023-10-18 00:55:53 -04:00
|
|
|
if: '$CI_COMMIT_REF_NAME != "master" && $CI_COMMIT_BRANCH !~ /^release\/v/ && $CI_COMMIT_TAG !~ /^v\d+\.\d+(\.\d+)?($|-)/ && $CI_COMMIT_TAG !~ /^qa-test/ && ($CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "merge_request_event")'
|
2021-04-27 00:24:22 -04:00
|
|
|
|
2023-10-17 00:05:22 -04:00
|
|
|
.if-schedule: &if-schedule
|
|
|
|
if: '$CI_PIPELINE_SOURCE == "schedule"'
|
|
|
|
|
2023-03-06 22:06:13 -05:00
|
|
|
.doc-rules:build:docs-full:
|
2021-04-27 00:24:22 -04:00
|
|
|
rules:
|
2023-10-18 00:55:53 -04:00
|
|
|
- <<: *if-qa-test-tag
|
|
|
|
when: never
|
2023-10-17 00:05:22 -04:00
|
|
|
- <<: *if-schedule
|
2021-04-27 00:24:22 -04:00
|
|
|
- <<: *if-label-build_docs
|
2023-03-06 22:06:13 -05:00
|
|
|
- <<: *if-label-docs_full
|
2021-04-27 00:24:22 -04:00
|
|
|
- <<: *if-dev-push
|
2023-03-06 22:06:13 -05:00
|
|
|
changes: *patterns-docs-full
|
|
|
|
|
2023-10-17 00:05:22 -04:00
|
|
|
.doc-rules:build:docs-full-prod:
|
|
|
|
rules:
|
|
|
|
- <<: *if-qa-test-tag
|
|
|
|
when: never
|
|
|
|
- <<: *if-protected-no_label
|
|
|
|
|
2023-03-06 22:06:13 -05:00
|
|
|
.doc-rules:build:docs-partial:
|
|
|
|
rules:
|
2023-10-18 00:55:53 -04:00
|
|
|
- <<: *if-qa-test-tag
|
|
|
|
when: never
|
2023-04-11 01:11:57 -04:00
|
|
|
- <<: *if-dev-push
|
|
|
|
changes: *patterns-docs-full
|
|
|
|
when: never
|
2023-03-06 22:06:13 -05:00
|
|
|
- <<: *if-dev-push
|
|
|
|
changes: *patterns-docs-partial
|
2021-04-27 00:24:22 -04:00
|
|
|
|
2020-11-04 04:07:33 -05:00
|
|
|
# stage: pre_check
|
|
|
|
check_readme_links:
|
|
|
|
extends:
|
2022-07-28 03:32:13 -04:00
|
|
|
- .pre_check_template
|
2021-02-08 23:31:38 -05:00
|
|
|
tags: ["build", "amd64", "internet"]
|
2020-11-04 04:07:33 -05:00
|
|
|
allow_failure: true
|
2023-03-06 22:06:13 -05:00
|
|
|
rules:
|
|
|
|
- <<: *if-protected
|
|
|
|
- <<: *if-dev-push
|
|
|
|
changes: *patterns-example-readme
|
2020-11-04 04:07:33 -05:00
|
|
|
script:
|
|
|
|
- python ${IDF_PATH}/tools/ci/check_readme_links.py
|
|
|
|
|
|
|
|
check_docs_lang_sync:
|
|
|
|
extends:
|
2022-07-28 03:32:13 -04:00
|
|
|
- .pre_check_template
|
2023-03-06 22:06:13 -05:00
|
|
|
- .doc-rules:build:docs-full
|
2020-11-04 04:07:33 -05:00
|
|
|
script:
|
|
|
|
- cd docs
|
|
|
|
- ./check_lang_folder_sync.sh
|
|
|
|
|
2021-02-08 23:31:38 -05:00
|
|
|
.build_docs_template:
|
|
|
|
image: $ESP_IDF_DOC_ENV_IMAGE
|
2023-03-06 22:06:13 -05:00
|
|
|
stage: build_doc
|
2021-02-08 23:31:38 -05:00
|
|
|
tags:
|
|
|
|
- build_docs
|
|
|
|
script:
|
2023-12-16 09:52:43 -05:00
|
|
|
- if [ -n "${BREATHE_ALT_INSTALL_URL}" ]; then pip uninstall -y breathe && pip install -U ${BREATHE_ALT_INSTALL_URL}; fi
|
2021-02-08 23:31:38 -05:00
|
|
|
- cd docs
|
2021-08-23 20:56:48 -04:00
|
|
|
- build-docs -t $DOCTGT -bs $DOC_BUILDERS -l $DOCLANG build
|
2024-02-16 07:43:53 -05:00
|
|
|
artifacts:
|
|
|
|
expire_in: 4 days
|
|
|
|
when: always
|
2021-02-08 23:31:38 -05:00
|
|
|
parallel:
|
|
|
|
matrix:
|
|
|
|
- DOCLANG: ["en", "zh_CN"]
|
2024-05-29 23:19:25 -04:00
|
|
|
DOCTGT: ["esp32", "esp32s2", "esp32s3", "esp32c3", "esp32c2", "esp32c6", "esp32c61", "esp32c5","esp32h2", "esp32p4"]
|
2021-02-08 23:31:38 -05:00
|
|
|
|
2020-11-04 04:07:33 -05:00
|
|
|
check_docs_gh_links:
|
2021-06-30 01:30:13 -04:00
|
|
|
image: $ESP_IDF_DOC_ENV_IMAGE
|
2020-11-04 04:07:33 -05:00
|
|
|
extends:
|
2022-07-28 03:32:13 -04:00
|
|
|
- .pre_check_template
|
2023-03-06 22:06:13 -05:00
|
|
|
- .doc-rules:build:docs-full
|
2020-11-04 04:07:33 -05:00
|
|
|
script:
|
|
|
|
- cd docs
|
2021-08-23 20:56:48 -04:00
|
|
|
- build-docs gh-linkcheck
|
2020-11-04 04:07:33 -05:00
|
|
|
|
2021-04-27 00:24:22 -04:00
|
|
|
# Doc jobs have a lot of special cases, we specify rules here directly instead
|
|
|
|
# in dependencies.yml to simplify things
|
|
|
|
build_docs_html_full:
|
2020-11-04 04:07:33 -05:00
|
|
|
extends:
|
2023-03-06 22:06:13 -05:00
|
|
|
- .build_docs_template
|
|
|
|
- .doc-rules:build:docs-full
|
2023-10-17 00:05:22 -04:00
|
|
|
needs:
|
|
|
|
- job: fast_template_app
|
|
|
|
artifacts: false
|
|
|
|
optional: true
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- docs/_build/*/*/*.txt
|
|
|
|
- docs/_build/*/*/html/*
|
|
|
|
variables:
|
|
|
|
DOC_BUILDERS: "html"
|
|
|
|
|
|
|
|
build_docs_html_full_prod:
|
|
|
|
extends:
|
|
|
|
- .build_docs_template
|
|
|
|
- .doc-rules:build:docs-full-prod
|
2023-11-06 03:39:28 -05:00
|
|
|
dependencies: [] # Stop build_docs jobs from downloading all previous job's artifacts
|
2020-11-04 04:07:33 -05:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- docs/_build/*/*/*.txt
|
|
|
|
- docs/_build/*/*/html/*
|
|
|
|
variables:
|
|
|
|
DOC_BUILDERS: "html"
|
|
|
|
|
2023-03-06 22:06:13 -05:00
|
|
|
build_docs_html_partial:
|
2021-04-27 00:24:22 -04:00
|
|
|
extends:
|
2023-03-06 22:06:13 -05:00
|
|
|
- .build_docs_template
|
|
|
|
- .doc-rules:build:docs-partial
|
2023-10-17 00:05:22 -04:00
|
|
|
needs:
|
|
|
|
- job: fast_template_app
|
|
|
|
artifacts: false
|
|
|
|
optional: true
|
2021-04-27 00:24:22 -04:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- docs/_build/*/*/*.txt
|
|
|
|
- docs/_build/*/*/html/*
|
|
|
|
variables:
|
|
|
|
DOC_BUILDERS: "html"
|
2023-03-06 22:06:13 -05:00
|
|
|
parallel:
|
|
|
|
matrix:
|
|
|
|
- DOCLANG: "en"
|
|
|
|
DOCTGT: "esp32"
|
|
|
|
- DOCLANG: "zh_CN"
|
2023-07-25 00:18:16 -04:00
|
|
|
DOCTGT: "esp32p4"
|
2021-04-27 00:24:22 -04:00
|
|
|
|
2020-11-04 04:07:33 -05:00
|
|
|
build_docs_pdf:
|
|
|
|
extends:
|
2023-03-06 22:06:13 -05:00
|
|
|
- .build_docs_template
|
|
|
|
- .doc-rules:build:docs-full
|
2023-10-17 00:05:22 -04:00
|
|
|
needs:
|
|
|
|
- job: fast_template_app
|
|
|
|
artifacts: false
|
|
|
|
optional: true
|
2024-06-21 03:43:20 -04:00
|
|
|
allow_failure: true # TODO IDFCI-2216
|
2023-10-17 00:05:22 -04:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- docs/_build/*/*/latex/*
|
|
|
|
variables:
|
|
|
|
DOC_BUILDERS: "latex"
|
|
|
|
|
|
|
|
build_docs_pdf_prod:
|
|
|
|
extends:
|
|
|
|
- .build_docs_template
|
|
|
|
- .doc-rules:build:docs-full-prod
|
2023-11-06 03:39:28 -05:00
|
|
|
dependencies: [] # Stop build_docs jobs from downloading all previous job's artifacts
|
2024-06-21 03:43:20 -04:00
|
|
|
allow_failure: true # TODO IDFCI-2216
|
2020-11-04 04:07:33 -05:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- docs/_build/*/*/latex/*
|
|
|
|
variables:
|
|
|
|
DOC_BUILDERS: "latex"
|
|
|
|
|
|
|
|
.deploy_docs_template:
|
|
|
|
image: $ESP_IDF_DOC_ENV_IMAGE
|
2021-05-26 04:44:20 -04:00
|
|
|
variables:
|
2021-12-06 00:36:21 -05:00
|
|
|
DOCS_BUILD_DIR: "${IDF_PATH}/docs/_build/"
|
|
|
|
PYTHONUNBUFFERED: 1
|
2021-02-08 23:31:38 -05:00
|
|
|
stage: test_deploy
|
2020-11-04 04:07:33 -05:00
|
|
|
tags:
|
|
|
|
- deploy
|
|
|
|
- shiny
|
|
|
|
script:
|
|
|
|
- add_doc_server_ssh_keys $DOCS_DEPLOY_PRIVATEKEY $DOCS_DEPLOY_SERVER $DOCS_DEPLOY_SERVER_USER
|
2021-10-28 00:07:02 -04:00
|
|
|
- export GIT_VER=$(git describe --always ${PIPELINE_COMMIT_SHA} --)
|
2021-08-23 20:56:48 -04:00
|
|
|
- deploy-docs
|
2020-11-04 04:07:33 -05:00
|
|
|
|
|
|
|
# stage: test_deploy
|
|
|
|
deploy_docs_preview:
|
|
|
|
extends:
|
|
|
|
- .deploy_docs_template
|
2021-04-27 00:24:22 -04:00
|
|
|
rules:
|
|
|
|
- <<: *if-label-build_docs
|
2023-03-06 22:06:13 -05:00
|
|
|
- <<: *if-label-docs_full
|
2021-10-13 06:19:05 -04:00
|
|
|
- <<: *if-dev-push
|
|
|
|
changes: *patterns-docs-preview
|
2022-03-25 04:18:54 -04:00
|
|
|
needs:
|
2023-03-06 22:06:13 -05:00
|
|
|
- job: build_docs_html_partial
|
2022-03-25 04:18:54 -04:00
|
|
|
optional: true
|
|
|
|
- job: build_docs_html_full
|
|
|
|
optional: true
|
|
|
|
- job: build_docs_pdf
|
|
|
|
optional: true
|
2020-11-04 04:07:33 -05:00
|
|
|
variables:
|
|
|
|
TYPE: "preview"
|
|
|
|
# older branches use DOCS_DEPLOY_KEY, DOCS_SERVER, DOCS_SERVER_USER, DOCS_PATH for preview server so we keep these names for 'preview'
|
|
|
|
DOCS_DEPLOY_PRIVATEKEY: "$DOCS_DEPLOY_KEY"
|
|
|
|
DOCS_DEPLOY_SERVER: "$DOCS_SERVER"
|
|
|
|
DOCS_DEPLOY_SERVER_USER: "$DOCS_SERVER_USER"
|
|
|
|
DOCS_DEPLOY_PATH: "$DOCS_PATH"
|
2021-10-13 04:03:14 -04:00
|
|
|
DOCS_DEPLOY_URL_BASE: "https://$DOCS_PREVIEW_SERVER_URL/docs/esp-idf"
|
2020-11-04 04:07:33 -05:00
|
|
|
|
|
|
|
# stage: post_deploy
|
|
|
|
deploy_docs_production:
|
|
|
|
# The DOCS_PROD_* variables used by this job are "Protected" so these branches must all be marked "Protected" in Gitlab settings
|
|
|
|
extends:
|
|
|
|
- .deploy_docs_template
|
2023-10-17 00:05:22 -04:00
|
|
|
- .doc-rules:build:docs-full-prod
|
2020-11-04 04:07:33 -05:00
|
|
|
stage: post_deploy
|
2021-02-08 23:31:38 -05:00
|
|
|
dependencies: # set dependencies to null to avoid missing artifacts issue
|
2020-11-04 04:07:33 -05:00
|
|
|
needs: # ensure runs after push_to_github succeeded
|
2023-10-17 00:05:22 -04:00
|
|
|
- build_docs_html_full_prod
|
|
|
|
- build_docs_pdf_prod
|
2021-02-08 23:31:38 -05:00
|
|
|
- job: push_to_github
|
|
|
|
artifacts: false
|
2020-11-04 04:07:33 -05:00
|
|
|
variables:
|
|
|
|
TYPE: "preview"
|
|
|
|
DOCS_DEPLOY_PRIVATEKEY: "$DOCS_PROD_DEPLOY_KEY"
|
|
|
|
DOCS_DEPLOY_SERVER: "$DOCS_PROD_SERVER"
|
|
|
|
DOCS_DEPLOY_SERVER_USER: "$DOCS_PROD_SERVER_USER"
|
|
|
|
DOCS_DEPLOY_PATH: "$DOCS_PROD_PATH"
|
|
|
|
DOCS_DEPLOY_URL_BASE: "https://docs.espressif.com/projects/esp-idf"
|
2021-11-09 04:11:01 -05:00
|
|
|
DEPLOY_STABLE: 1
|
2020-11-04 04:07:33 -05:00
|
|
|
|
|
|
|
check_doc_links:
|
|
|
|
extends:
|
|
|
|
- .build_docs_template
|
2023-10-17 00:05:22 -04:00
|
|
|
- .doc-rules:build:docs-full-prod
|
2020-11-04 04:07:33 -05:00
|
|
|
stage: post_deploy
|
2023-03-05 22:44:20 -05:00
|
|
|
needs:
|
|
|
|
- job: deploy_docs_production
|
|
|
|
artifacts: false
|
2020-11-04 04:07:33 -05:00
|
|
|
tags: ["build", "amd64", "internet"]
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- docs/_build/*/*/*.txt
|
|
|
|
- docs/_build/*/*/linkcheck/*.txt
|
|
|
|
allow_failure: true
|
|
|
|
script:
|
|
|
|
- cd docs
|
2022-04-28 03:59:03 -04:00
|
|
|
- build-docs -t $DOCTGT -l $DOCLANG linkcheck
|