Răsfoiți Sursa

gitlab-ci: fix setting GitHub deploy key

- don't run default before_script before push_master_to_github job
- replace echo >> with echo > to avoid mistakes in the future
Ivan Grokhotkov 9 ani în urmă
părinte
comite
d7f7c36af0
1 a modificat fișierele cu 4 adăugiri și 3 ștergeri
  1. 4 3
      .gitlab-ci.yml

+ 4 - 3
.gitlab-ci.yml

@@ -7,7 +7,7 @@ before_script:
   # add gitlab ssh key
   # add gitlab ssh key
   - mkdir -p ~/.ssh
   - mkdir -p ~/.ssh
   - chmod 700 ~/.ssh
   - chmod 700 ~/.ssh
-  - echo -n $GITLAB_KEY >> ~/.ssh/id_rsa_base64
+  - echo -n $GITLAB_KEY > ~/.ssh/id_rsa_base64
   - base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
   - base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
   - chmod 600 ~/.ssh/id_rsa
   - chmod 600 ~/.ssh/id_rsa
   - echo -e "Host gitlab.espressif.cn\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
   - echo -e "Host gitlab.espressif.cn\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
@@ -125,8 +125,9 @@ sanity_test:
     - CONFIG_FILE=sanity_test.yml
     - CONFIG_FILE=sanity_test.yml
 
 
 
 
-
 push_master_to_github:
 push_master_to_github:
+  before_script: 
+    - echo "Not setting up GitLab key, not fetching submodules"
   stage: deploy
   stage: deploy
   only:
   only:
     - master
     - master
@@ -139,7 +140,7 @@ push_master_to_github:
   script:
   script:
     - mkdir -p ~/.ssh
     - mkdir -p ~/.ssh
     - chmod 700 ~/.ssh
     - chmod 700 ~/.ssh
-    - echo -n $GH_PUSH_KEY >> ~/.ssh/id_rsa_base64
+    - echo -n $GH_PUSH_KEY > ~/.ssh/id_rsa_base64
     - base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
     - base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
     - chmod 600 ~/.ssh/id_rsa
     - chmod 600 ~/.ssh/id_rsa
     - echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
     - echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config