2019-06-28 16:39:21 +00:00
|
|
|
.clang_tidy_deploy_template:
|
|
|
|
stage: deploy
|
|
|
|
image: $CI_DOCKER_REGISTRY/esp32-ci-env
|
|
|
|
tags:
|
|
|
|
- deploy
|
2020-01-10 10:36:52 +00:00
|
|
|
- shiny
|
2019-06-28 16:39:21 +00:00
|
|
|
script:
|
|
|
|
- mkdir -p ~/.ssh
|
|
|
|
- chmod 700 ~/.ssh
|
|
|
|
- echo -n $DOCS_DEPLOY_KEY > ~/.ssh/id_rsa_base64
|
|
|
|
- base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
|
|
|
|
- chmod 600 ~/.ssh/id_rsa
|
|
|
|
- echo -e "Host $DOCS_SERVER\n\tStrictHostKeyChecking no\n\tUser $DOCS_SERVER_USER\n" >> ~/.ssh/config
|
|
|
|
- export GIT_VER=$(git describe --always)
|
|
|
|
- cd $IDF_PATH/examples/get-started/hello_world/tidybuild
|
|
|
|
- mv report $GIT_VER
|
|
|
|
- tar czvf $GIT_VER.tar.gz $GIT_VER
|
|
|
|
- export STATIC_REPORT_PATH="web/static_analysis/esp-idf/"
|
|
|
|
- ssh $DOCS_SERVER -x "mkdir -p $STATIC_REPORT_PATH/clang-tidy"
|
|
|
|
- scp $GIT_VER.tar.gz $DOCS_SERVER:$STATIC_REPORT_PATH/clang-tidy
|
|
|
|
- ssh $DOCS_SERVER -x "cd $STATIC_REPORT_PATH/clang-tidy && tar xzvf $GIT_VER.tar.gz && rm -f latest && ln -s $GIT_VER latest"
|
|
|
|
# add link to view the report
|
|
|
|
- echo "[static analysis][clang tidy] $CI_DOCKER_REGISTRY/static_analysis/esp-idf/clang-tidy/${GIT_VER}/index.html"
|
|
|
|
- test ! -e ${GIT_VER}/FAILED_RULES || { echo 'Failed static analysis rules!'; cat ${GIT_VER}/FAILED_RULES; exit 1; }
|
|
|
|
|
|
|
|
clang_tidy_deploy:
|
|
|
|
extends: .clang_tidy_deploy_template
|
2020-06-10 03:32:43 +00:00
|
|
|
# Override default stage to happen before the post_check
|
|
|
|
stage: test_deploy
|
2019-06-28 16:39:21 +00:00
|
|
|
dependencies:
|
|
|
|
- clang_tidy_check
|
|
|
|
- clang_tidy_check_all
|
|
|
|
variables:
|
|
|
|
BOT_NEEDS_TRIGGER_BY_NAME: 1
|
|
|
|
|
|
|
|
clang_tidy_deploy_regular:
|
|
|
|
extends: .clang_tidy_deploy_template
|
|
|
|
dependencies:
|
|
|
|
- clang_tidy_check_regular
|
|
|
|
only:
|
|
|
|
refs:
|
|
|
|
- master
|
|
|
|
- /^release\/v/
|
|
|
|
- /^v\d+\.\d+(\.\d+)?($|-)/
|
|
|
|
- triggers
|
|
|
|
- schedules
|
|
|
|
variables:
|
|
|
|
- $BOT_LABEL_STATIC_ANALYSIS
|
|
|
|
- $BOT_LABEL_STATIC_ANALYSIS_ALL
|
|
|
|
|
|
|
|
push_to_github:
|
|
|
|
stage: deploy
|
|
|
|
image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
|
|
|
|
tags:
|
|
|
|
- deploy
|
|
|
|
only:
|
2020-05-22 05:04:39 +00:00
|
|
|
refs:
|
|
|
|
- master
|
|
|
|
- /^release\/v/
|
|
|
|
- /^v\d+\.\d+(\.\d+)?($|-)/
|
|
|
|
variables:
|
|
|
|
- $BOT_TRIGGER_WITH_LABEL == null
|
2019-06-28 16:39:21 +00:00
|
|
|
when: on_success
|
|
|
|
dependencies: []
|
|
|
|
extends: .before_script_lesser
|
|
|
|
script:
|
|
|
|
- mkdir -p ~/.ssh
|
|
|
|
- chmod 700 ~/.ssh
|
|
|
|
- echo -n $GH_PUSH_KEY > ~/.ssh/id_rsa_base64
|
|
|
|
- base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
|
|
|
|
- chmod 600 ~/.ssh/id_rsa
|
|
|
|
- echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
|
|
|
|
- git remote remove github &>/dev/null || true
|
|
|
|
- git remote add github git@github.com:espressif/esp-idf.git
|
|
|
|
- tools/ci/push_to_github.sh
|
|
|
|
|
2020-02-18 04:08:22 +00:00
|
|
|
.deploy_docs_template:
|
|
|
|
extends: .before_script_lesser
|
2019-06-28 16:39:21 +00:00
|
|
|
stage: deploy
|
2020-02-18 04:08:22 +00:00
|
|
|
image: $ESP_IDF_DOC_ENV_IMAGE
|
2019-06-28 16:39:21 +00:00
|
|
|
tags:
|
|
|
|
- deploy
|
2020-01-10 10:36:52 +00:00
|
|
|
- shiny
|
2019-06-28 16:39:21 +00:00
|
|
|
dependencies:
|
2019-11-22 07:58:32 +00:00
|
|
|
- build_docs_en_esp32
|
|
|
|
- build_docs_en_esp32s2
|
|
|
|
- build_docs_zh_CN_esp32
|
|
|
|
- build_docs_zh_CN_esp32s2
|
2020-02-18 04:08:22 +00:00
|
|
|
variables:
|
|
|
|
DOCS_BUILD_DIR: "${IDF_PATH}/docs/_build/"
|
|
|
|
PYTHONUNBUFFERED: 1
|
2019-06-28 16:39:21 +00:00
|
|
|
script:
|
|
|
|
- mkdir -p ~/.ssh
|
|
|
|
- chmod 700 ~/.ssh
|
2020-02-18 04:08:22 +00:00
|
|
|
- echo -n $DOCS_DEPLOY_PRIVATEKEY > ~/.ssh/id_rsa_base64
|
2019-06-28 16:39:21 +00:00
|
|
|
- base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
|
|
|
|
- chmod 600 ~/.ssh/id_rsa
|
2020-02-18 04:08:22 +00:00
|
|
|
- echo -e "Host $DOCS_DEPLOY_SERVER\n\tStrictHostKeyChecking no\n\tUser $DOCS_DEPLOY_SERVER_USER\n" >> ~/.ssh/config
|
2019-06-28 16:39:21 +00:00
|
|
|
- export GIT_VER=$(git describe --always)
|
2019-11-22 07:58:32 +00:00
|
|
|
|
2020-02-18 04:08:22 +00:00
|
|
|
- ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh -p 3.6.10 ${IDF_PATH}/tools/ci/deploy_docs.py
|
2019-11-22 07:58:32 +00:00
|
|
|
|
2020-02-19 04:24:59 +00:00
|
|
|
|
|
|
|
# deploys docs to CI_DOCKER_REGISTRY webserver, for internal review
|
|
|
|
deploy_docs_preview:
|
|
|
|
extends: .deploy_docs_template
|
2020-06-10 03:32:43 +00:00
|
|
|
# Override default stage to happen before the post_check
|
|
|
|
stage: test_deploy
|
2020-02-19 04:24:59 +00:00
|
|
|
only:
|
|
|
|
refs:
|
|
|
|
- triggers
|
|
|
|
variables:
|
|
|
|
- $BOT_TRIGGER_WITH_LABEL == null
|
|
|
|
- $BOT_LABEL_BUILD_DOCS
|
|
|
|
variables:
|
|
|
|
TYPE: "preview"
|
2020-02-18 04:08:22 +00:00
|
|
|
# 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"
|
|
|
|
DOCS_DEPLOY_URL_BASE: "https://$CI_DOCKER_REGISTRY/docs/esp-idf"
|
2020-02-19 04:24:59 +00:00
|
|
|
|
|
|
|
# deploy docs to production webserver
|
|
|
|
deploy_docs_production:
|
|
|
|
extends: .deploy_docs_template
|
|
|
|
only:
|
|
|
|
refs:
|
2020-02-18 04:08:22 +00:00
|
|
|
# The DOCS_PROD_* variables used by this job are "Protected" so these branches must all be marked "Protected" in Gitlab settings
|
2020-02-19 04:24:59 +00:00
|
|
|
- master
|
|
|
|
- /^release\/v/
|
|
|
|
- /^v\d+\.\d+(\.\d+)?($|-)/
|
2020-05-22 05:04:39 +00:00
|
|
|
variables:
|
|
|
|
- $BOT_TRIGGER_WITH_LABEL == null
|
2020-02-19 04:24:59 +00:00
|
|
|
variables:
|
|
|
|
TYPE: "preview"
|
2020-02-18 04:08:22 +00:00
|
|
|
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"
|
2019-06-28 16:39:21 +00:00
|
|
|
|
|
|
|
deploy_test_result:
|
|
|
|
stage: deploy
|
|
|
|
image: $CI_DOCKER_REGISTRY/bot-env
|
|
|
|
tags:
|
|
|
|
- deploy_test
|
|
|
|
when: always
|
|
|
|
only:
|
|
|
|
refs:
|
|
|
|
- master
|
|
|
|
- schedules
|
|
|
|
artifacts:
|
|
|
|
when: always
|
|
|
|
paths:
|
|
|
|
- ${CI_PROJECT_DIR}/test-management/*.log
|
|
|
|
# save all test logs as artifacts, make it easier to track errors
|
|
|
|
- ${CI_PROJECT_DIR}/TEST_LOGS
|
|
|
|
- $CI_PROJECT_DIR/$CI_COMMIT_SHA
|
|
|
|
expire_in: 1 mos
|
|
|
|
variables:
|
|
|
|
UNIT_TEST_CASE_FILE: "${CI_PROJECT_DIR}/components/idf_test/unit_test/TestCaseAll.yml"
|
|
|
|
BOT_ACCOUNT_CONFIG_FILE: "${CI_PROJECT_DIR}/test-management/Config/Account.local.yml"
|
|
|
|
TEST_FW_PATH: "$CI_PROJECT_DIR/tools/tiny-test-fw"
|
|
|
|
AUTO_TEST_SCRIPT_PATH: "${CI_PROJECT_DIR}/auto_test_script"
|
|
|
|
before_script:
|
|
|
|
- mkdir -p ~/.ssh
|
|
|
|
- chmod 700 ~/.ssh
|
|
|
|
- echo -n $GITLAB_KEY > ~/.ssh/id_rsa_base64
|
|
|
|
- base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
|
|
|
|
- chmod 600 ~/.ssh/id_rsa
|
|
|
|
- echo -e "Host gitlab.espressif.cn\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
|
|
|
|
script:
|
|
|
|
- export GIT_SHA=$(echo ${CI_COMMIT_SHA} | cut -c 1-8)
|
|
|
|
- export REV_COUNT=$(git rev-list --count HEAD)
|
|
|
|
- export SUMMARY="IDF CI test result for $GIT_SHA (r${REV_COUNT})"
|
|
|
|
# artifacts of job update_test_cases creates test-management folder
|
|
|
|
# we need to remove it so we can clone test-management folder again
|
|
|
|
- rm -r test-management
|
|
|
|
- git clone $TEST_MANAGEMENT_REPO
|
|
|
|
- python3 $CHECKOUT_REF_SCRIPT test-management test-management
|
|
|
|
- cd test-management
|
|
|
|
- echo $BOT_JIRA_ACCOUNT > ${BOT_ACCOUNT_CONFIG_FILE}
|
|
|
|
# update test results
|
|
|
|
- python3 ImportTestResult.py -r "$GIT_SHA (r${REV_COUNT})" -j $JIRA_TEST_MANAGEMENT_PROJECT -s "$SUMMARY" -l CI -p ${CI_PROJECT_DIR}/TEST_LOGS ${CI_PROJECT_DIR}/${CI_COMMIT_SHA} --pipeline_url ${CI_PIPELINE_URL}
|