deploy.yml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. .deploy_job_template:
  2. extends: .before_script_no_sync_submodule
  3. stage: deploy
  4. image: $ESP_ENV_IMAGE
  5. tags:
  6. - deploy
  7. push_to_github:
  8. extends:
  9. - .deploy_job_template
  10. - .before_script_minimal
  11. - .rules:protected-no_label
  12. dependencies: []
  13. script:
  14. - add_github_ssh_keys
  15. - git remote remove github &>/dev/null || true
  16. - git remote add github git@github.com:espressif/esp-idf.git
  17. - tools/ci/push_to_github.sh
  18. deploy_test_result:
  19. extends:
  20. - .deploy_job_template
  21. - .before_script_minimal
  22. - .rules:ref:master-schedule-always
  23. image: $CI_DOCKER_REGISTRY/bot-env
  24. tags:
  25. - deploy_test
  26. artifacts:
  27. when: always
  28. paths:
  29. - ${CI_PROJECT_DIR}/test-management/*.log
  30. # save all test logs as artifacts, make it easier to track errors
  31. - ${CI_PROJECT_DIR}/TEST_LOGS
  32. expire_in: 1 mos
  33. variables:
  34. UNIT_TEST_CASE_FILE: "${CI_PROJECT_DIR}/components/idf_test/unit_test/TestCaseAll.yml"
  35. BOT_ACCOUNT_CONFIG_FILE: "${CI_PROJECT_DIR}/test-management/Config/Account.local.yml"
  36. TEST_FW_PATH: "$CI_PROJECT_DIR/tools/tiny-test-fw"
  37. AUTO_TEST_SCRIPT_PATH: "${CI_PROJECT_DIR}/auto_test_script"
  38. script:
  39. - add_gitlab_ssh_keys
  40. - export GIT_SHA=$(echo ${PIPELINE_COMMIT_SHA} | cut -c 1-8)
  41. - export REV_COUNT=$(git rev-list --count ${PIPELINE_COMMIT_SHA} --)
  42. - export SUMMARY="IDF CI test result for $GIT_SHA (r${REV_COUNT})"
  43. # artifacts of job update_test_cases creates test-management folder
  44. # we need to remove it so we can clone test-management folder again
  45. - rm -rf test-management
  46. - retry_failed git clone $TEST_MANAGEMENT_REPO
  47. - python3 $CHECKOUT_REF_SCRIPT test-management test-management
  48. - cd test-management
  49. - echo $BOT_JIRA_ACCOUNT > ${BOT_ACCOUNT_CONFIG_FILE}
  50. # update test results
  51. - python3 ImportTestResult.py -r "$GIT_SHA (r${REV_COUNT})" -j $JIRA_TEST_MANAGEMENT_PROJECT -s "$SUMMARY" -l CI -p ${CI_PROJECT_DIR}/TEST_LOGS --pipeline_url ${CI_PIPELINE_URL}
  52. check_submodule_sync:
  53. extends:
  54. - .deploy_job_template
  55. - .rules:test:submodule
  56. tags:
  57. - github_sync
  58. retry: 2
  59. variables:
  60. GIT_STRATEGY: clone
  61. SUBMODULES_TO_FETCH: "none"
  62. PUBLIC_IDF_URL: "https://github.com/espressif/esp-idf.git"
  63. dependencies: []
  64. script:
  65. - git submodule deinit --force .
  66. # setting the default remote URL to the public one, to resolve relative location URLs
  67. - git config remote.origin.url ${PUBLIC_IDF_URL}
  68. # check if all submodules are correctly synced to public repository
  69. - git submodule init
  70. - git config --get-regexp '^submodule\..*\.url$' || true
  71. - git submodule update --recursive
  72. - echo "IDF was cloned from ${PUBLIC_IDF_URL} completely"