From 50c4692657fce2b173e77c839ae2e21ac4e5c467 Mon Sep 17 00:00:00 2001 From: Wolfgang Hottgenroth Date: Tue, 12 Feb 2019 16:31:19 +0100 Subject: [PATCH] fix use ssh in ci script --- .gitlab-ci.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b213ee2..697cc83 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,6 +2,16 @@ stages: - hello - build +before_script: + - echo "Prepare ssh environment" + - eval $(ssh-agent -s) + - echo "$SSH_PRIVATE_KEY" | ssh-add + - mkdir -p ~/.ssh + - chmod 700 ~/.ssh + - ssh-keyscan gitlab.com >> ~/.ssh/known_hosts + - chmod 644 ~/.ssh/known_hosts + - echo "Preparing ssh environment done" + job1: stage: hello tags: @@ -38,12 +48,6 @@ job3: - apt install -y msp430-libc - apt install -y binutils-msp430 - apt install -y gcc-msp430 - - eval $(ssh-agent -s) - - echo "$SSH_PRIVATE_KEY" | ssh-add - - mkdir -p ~/.ssh - - chmod 700 ~/.ssh - - ssh-keyscan gitlab.com >> ~/.ssh/known_hosts - - chmod 644 ~/.ssh/known_hosts script: - make clean - make all