Browse Source

Update .gitlab-ci.yml file

Juraj Ďuďák 2 years ago
parent
commit
de4ee82b88
1 changed files with 16 additions and 10 deletions
  1. 16 10
      .gitlab-ci.yml

+ 16 - 10
.gitlab-ci.yml

@@ -1,13 +1,3 @@
-before_script:
-    # Setup SSH deploy keys
-    - 'which ssh-agent || ( apt-get install -qq openssh-client )'
-    - eval $(ssh-agent -s)
-    - mkdir -p ~/.ssh
-    - chmod 600 ~/.ssh
-    - echo "$SSH_KEY" | tr -d '\r' > ~/.ssh/id_rsa
-    - chmod 600 ~/.ssh/id_rsa
-    - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
-
 stages: 
     - checks
     - build_release
@@ -26,6 +16,14 @@ build_release:
     image: python
     only:
         - main
+    before_script:
+        - 'which ssh-agent || ( apt-get install -qq openssh-client )'
+        - eval $(ssh-agent -s)
+        - mkdir -p ~/.ssh
+        - chmod 600 ~/.ssh
+        - echo "$SSH_KEY" | tr -d '\r' > ~/.ssh/id_rsa
+        - chmod 600 ~/.ssh/id_rsa
+        - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'        
     script:
         - ssh -t -t -p 90 $DEST_IP mkdir -p $DEST_PATH/$CI_PROJECT_NAME
         - scp -r -P 90 ./readme.md $DEST_IP:$DEST_PATH/$CI_PROJECT_NAME/readme.md
@@ -44,6 +42,14 @@ doxy_stage:
     image: hrektts/doxygen
     only:
         - main
+    before_script:
+        - 'which ssh-agent || ( apt-get install -qq openssh-client )'
+        - eval $(ssh-agent -s)
+        - mkdir -p ~/.ssh
+        - chmod 600 ~/.ssh
+        - echo "$SSH_KEY" | tr -d '\r' > ~/.ssh/id_rsa
+        - chmod 600 ~/.ssh/id_rsa
+        - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
     script:
         #doxygen
         - doxygen Doxyfile