From 5a41e29a6fb9c831a01b75524ea55847b05b15d2 Mon Sep 17 00:00:00 2001 From: James Blair Date: Sat, 19 Jun 2021 22:10:33 +0000 Subject: [PATCH] Add keyscan for known hosts. --- .gitlab-ci.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 923bad6..6243dc7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,20 +7,25 @@ before_script: - eval $(ssh-agent -s) - echo "${SSH_PRIVATE_KEY}" | tr -d '\r' | ssh-add - > /dev/null + # Ensure known hosts exists and is populated + mkdir ~/.ssh && chmod 700 ~/.ssh + ssh-keyscan -p 2224 gitlab.jamma.life >> ~/.ssh/known_hosts + push_github: type: deploy environment: name: github url: github.com/jmhbnz/tooling script: - - git status - - git remote -v - - git checkout master + # Output git status + - git checkout master && git status + # Add a new remote for github - git remote add github git@github.com:jmhbnz/tooling.git || true # Push to the new remote - git push github master + only: refs: - master