# fetch the submodules (& if necessary re-fetch repo) from gitlab
- time ./tools/ci/get-full-sources.sh
+.do_nothing_before:
+ before_script: &do_nothing_before
+ - echo "Not setting up GitLab key, not fetching submodules"
+ - source tools/ci/configure_ci_environment.sh
+
+.add_gitlab_key_before:
+ before_script: &add_gitlab_key_before
+ - echo "Not fetching submodules"
+ - source tools/ci/configure_ci_environment.sh
+ # add gitlab ssh key
+ - 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
+
build_template_app:
stage: build
image: $CI_DOCKER_REGISTRY/esp32-ci-env
- test "${TEST_RESULT}" = "Pass" || exit 1
push_master_to_github:
- before_script:
- - echo "Not setting up GitLab key, not fetching submodules"
stage: deploy
image: $CI_DOCKER_REGISTRY/esp32-ci-env
tags:
dependencies: []
variables:
GITHUB_PUSH_REFS: refs/remotes/origin/release refs/remotes/origin/master
+ before_script: *do_nothing_before
script:
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
deploy_docs:
- before_script:
- - echo "Not setting up GitLab key, not fetching submodules"
stage: deploy
image: $CI_DOCKER_REGISTRY/esp32-ci-env
tags:
- triggers
dependencies:
- build_docs
+ before_script: *do_nothing_before
script:
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- /^release\/v/
- /^v\d+\.\d+(\.\d+)?($|-)/
dependencies: []
- before_script:
- - echo "Not setting up GitLab key, not fetching submodules"
+ before_script: *do_nothing_before
script:
- git status
- git log -n10 --oneline
dependencies: []
variables:
GIT_STRATEGY: clone
- before_script:
- - echo "Not setting up GitLab key, not fetching submodules"
+ before_script: *do_nothing_before
script:
# check if all submodules are correctly synced to public repostory
- git submodule update --init --recursive
- components/idf_test/*/CIConfigs
- components/idf_test/*/TC.sqlite
expire_in: 1 mos
- before_script:
- - echo "Not fetching submodules"
- # add gitlab ssh key
- - 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
+ before_script: *add_gitlab_key_before
script:
# first move test bins together: test_bins/CHIP_SDK/TestApp/bin_files
- mkdir -p test_bins/ESP32_IDF/UT
TEST_CASE_FILE_PATH: "$CI_PROJECT_DIR/components/idf_test/integration_test"
MODULE_UPDATE_FILE: "$CI_PROJECT_DIR/components/idf_test/ModuleDefinition.yml"
CONFIG_FILE: "$CI_PROJECT_DIR/components/idf_test/integration_test/CIConfigs/$CI_JOB_NAME.yml"
- before_script:
- - echo "Not fetching submodules"
- # add gitlab ssh key
- - 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
+ before_script: *add_gitlab_key_before
script:
# first test if config file exists, if not exist, exit 0
- test -e $CONFIG_FILE || exit 0