From 51ac10b3ebd7e6d2aa140d80bd4439bf81db2247 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?David=20Hrb=C3=A1=C4=8D?= <david@hrbac.cz>
Date: Mon, 31 Oct 2016 23:17:41 +0100
Subject: [PATCH] test ssh the stage

---
 .gitlab-ci.yml | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index d32a907f2..dd2960e78 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -29,6 +29,16 @@ deploy to stage:
   environment: stage 
   stage: deploy
   image: ruby:latest
+  before_script:
+  # install ssh-agent 
+  - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
+  # run ssh-agent
+  - eval $(ssh-agent -s)
+  # add ssh key stored in SSH_PRIVATE_KEY variable to the agent store
+  - ssh-add <(echo "$SSH_PRIVATE_KEY")
+  # disable host key checking (NOTE: makes you susceptible to man-in-the-middle attacks)
+  # WARNING: use only in docker container, if you use it with shell you will overwrite your user's ssh config
+` - mkdir -p ~/.ssh - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config 
   script:
   - gem install dpl
   - echo $CI_BUILD_REF_NAME
-- 
GitLab