deploy.yml 2.7 KB

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