]> granicus.if.org Git - esp-idf/commitdiff
add gitlab key in test template job
authorYinling <heyinling@espressif.com>
Thu, 29 Sep 2016 05:38:29 +0000 (13:38 +0800)
committerAngus Gratton <angus@espressif.com>
Tue, 11 Oct 2016 06:23:46 +0000 (17:23 +1100)
.gitlab-ci.yml

index a258da418a60db3a21b96e8becbd278faf5d9644..952cba7d78c7c3fed130dc055f8c79304461ae64 100644 (file)
@@ -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: