diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d32a907f28fccde05689a3fc14b1e2460557134b..dd2960e789873f1467f00e9aaf80a95f6baf772c 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