2020-09-27 03:20:53 +00:00
|
|
|
.deploy_job_template:
|
2019-06-28 16:39:21 +00:00
|
|
|
stage: deploy
|
2021-05-26 08:44:20 +00:00
|
|
|
image: $ESP_ENV_IMAGE
|
2020-09-27 03:20:53 +00:00
|
|
|
tags:
|
|
|
|
- deploy
|
|
|
|
|
2021-12-06 05:35:54 +00:00
|
|
|
# Check this before push_to_github
|
|
|
|
check_submodule_sync:
|
|
|
|
extends:
|
|
|
|
- .deploy_job_template
|
|
|
|
- .rules:test:submodule
|
|
|
|
stage: test_deploy
|
|
|
|
tags:
|
|
|
|
- github_sync
|
|
|
|
retry: 2
|
|
|
|
variables:
|
|
|
|
GIT_STRATEGY: clone
|
|
|
|
SUBMODULES_TO_FETCH: "none"
|
|
|
|
PUBLIC_IDF_URL: "https://github.com/espressif/esp-idf.git"
|
|
|
|
dependencies: []
|
|
|
|
script:
|
|
|
|
- git submodule deinit --force .
|
|
|
|
# setting the default remote URL to the public one, to resolve relative location URLs
|
|
|
|
- git config remote.origin.url ${PUBLIC_IDF_URL}
|
|
|
|
# check if all submodules are correctly synced to public repository
|
|
|
|
- git submodule init
|
|
|
|
- git config --get-regexp '^submodule\..*\.url$' || true
|
|
|
|
- git submodule update --recursive
|
|
|
|
- echo "IDF was cloned from ${PUBLIC_IDF_URL} completely"
|
|
|
|
|
2019-06-28 16:39:21 +00:00
|
|
|
push_to_github:
|
2020-09-27 03:20:53 +00:00
|
|
|
extends:
|
|
|
|
- .deploy_job_template
|
2021-02-16 16:45:06 +00:00
|
|
|
- .before_script_minimal
|
2020-10-20 07:00:50 +00:00
|
|
|
- .rules:protected-no_label
|
2021-05-21 07:31:34 +00:00
|
|
|
dependencies: []
|
2019-06-28 16:39:21 +00:00
|
|
|
script:
|
2020-09-27 03:20:53 +00:00
|
|
|
- add_github_ssh_keys
|
2019-06-28 16:39:21 +00:00
|
|
|
- git remote remove github &>/dev/null || true
|
|
|
|
- git remote add github git@github.com:espressif/esp-idf.git
|
|
|
|
- tools/ci/push_to_github.sh
|
|
|
|
|
|
|
|
deploy_test_result:
|
2020-09-27 03:20:53 +00:00
|
|
|
extends:
|
|
|
|
- .deploy_job_template
|
2021-02-22 12:44:11 +00:00
|
|
|
- .before_script_minimal
|
2022-07-07 15:32:12 +00:00
|
|
|
- .rules:ref:master-always
|
2022-02-21 10:56:56 +00:00
|
|
|
image: $CI_DOCKER_REGISTRY/bot-env:1
|
|
|
|
dependencies: []
|
2019-06-28 16:39:21 +00:00
|
|
|
tags:
|
|
|
|
- deploy_test
|
|
|
|
artifacts:
|
|
|
|
when: always
|
|
|
|
paths:
|
|
|
|
- ${CI_PROJECT_DIR}/test-management/*.log
|
2022-02-21 10:56:56 +00:00
|
|
|
expire_in: 1 week
|
2019-06-28 16:39:21 +00:00
|
|
|
variables:
|
|
|
|
BOT_ACCOUNT_CONFIG_FILE: "${CI_PROJECT_DIR}/test-management/Config/Account.local.yml"
|
2022-02-21 10:56:56 +00:00
|
|
|
TEST_RESULTS_PATH: "${CI_PROJECT_DIR}/TEST_RESULTS"
|
2019-06-28 16:39:21 +00:00
|
|
|
script:
|
2020-09-27 03:20:53 +00:00
|
|
|
- add_gitlab_ssh_keys
|
2022-02-21 10:56:56 +00:00
|
|
|
- export GIT_SHA=$(echo ${CI_COMMIT_SHA} | cut -c 1-8)
|
|
|
|
- export REV_COUNT=$(git rev-list --count ${GIT_SHA} --)
|
2019-06-28 16:39:21 +00:00
|
|
|
- export SUMMARY="IDF CI test result for $GIT_SHA (r${REV_COUNT})"
|
2022-02-21 10:56:56 +00:00
|
|
|
# Download test result
|
|
|
|
- export PYTHONPATH="$IDF_PATH/tools:$IDF_PATH/tools/ci/python_packages:$PYTHONPATH"
|
|
|
|
- python3 ${IDF_PATH}/tools/ci/get_all_test_results.py --path ${TEST_RESULTS_PATH} --include_retried
|
|
|
|
- if [[ -z $(find ${TEST_RESULTS_PATH} -name "*.xml") ]]; then exit 0; fi
|
|
|
|
# Clone test-management repo
|
2020-09-28 06:27:10 +00:00
|
|
|
- retry_failed git clone $TEST_MANAGEMENT_REPO
|
2019-06-28 16:39:21 +00:00
|
|
|
- python3 $CHECKOUT_REF_SCRIPT test-management test-management
|
|
|
|
- cd test-management
|
|
|
|
- echo $BOT_JIRA_ACCOUNT > ${BOT_ACCOUNT_CONFIG_FILE}
|
2022-02-21 10:56:56 +00:00
|
|
|
# Make sure all requirements are installed
|
|
|
|
- pip3 install -r requirements.txt
|
|
|
|
# Update test cases
|
|
|
|
- python3 ImportTestCase.py $JIRA_TEST_MANAGEMENT_PROJECT from_xml -d ${TEST_RESULTS_PATH} -r $GIT_SHA -l IDFCI
|
2019-06-28 16:39:21 +00:00
|
|
|
# update test results
|
2022-02-21 10:56:56 +00:00
|
|
|
- python3 ImportTestResult.py -r "$GIT_SHA (r${REV_COUNT})" -j $JIRA_TEST_MANAGEMENT_PROJECT -s "$SUMMARY" -l IDFCI -p ${TEST_RESULTS_PATH} --pipeline_url ${CI_PIPELINE_URL}
|
2022-02-09 10:00:54 +00:00
|
|
|
# May need a long time to upload all test results.
|
|
|
|
timeout: 4 hours
|