From 4929534448cbcc711bb180ce29d3ecc8a4df37e4 Mon Sep 17 00:00:00 2001 From: Yinling Date: Thu, 29 Sep 2016 13:38:29 +0800 Subject: [PATCH] add gitlab key in test template job --- .gitlab-ci.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a258da418..952cba7d7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -64,6 +64,7 @@ build_ssc: script: - git clone $GITLAB_SSH_SERVER/yinling/SSC.git - cd SSC + - git checkout ${CI_BUILD_REF_NAME} || echo "Using SSC default branch..." - make defconfig - chmod +x gen_misc_ng.sh - ./gen_misc_ng.sh @@ -137,8 +138,17 @@ push_master_to_github: expire_in: 6 mos script: + # 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 + # clone test bench - git clone $GITLAB_SSH_SERVER/yinling/auto_test_script.git - cd auto_test_script + # run test - python CIRunner.py -l $LOG_PATH -c $CONFIG_FILE -e $LOCAL_ENV_CONFIG_PATH -t $TEST_CASE_FILE_PATH bin_path $APP_NAME $BIN_PATH @@ -151,8 +161,17 @@ push_master_to_github: script: # must be night build triggers, otherwise exit without test - test $NIGHT_BUILD != "Yes" || exit 0 + # 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 + # clone test bench - git clone $GITLAB_SSH_SERVER/yinling/auto_test_script.git - cd auto_test_script + # run test - python CIRunner.py -l $LOG_PATH -c $CONFIG_FILE -e $LOCAL_ENV_CONFIG_PATH -t $TEST_CASE_FILE_PATH bin_path $APP_NAME $BIN_PATH Function_SYS_01: