Skip to content
Snippets Groups Projects
Commit 48b05910 authored by Robert Rosca's avatar Robert Rosca
Browse files

Use different method to modify known hosts

parent c85c00a3
No related branches found
No related tags found
1 merge request!437Fix/requirements into setuppy
...@@ -5,9 +5,13 @@ stages: ...@@ -5,9 +5,13 @@ stages:
.setup-ssh-euxfel-gitlab: &setup-ssh-euxfel-gitlab .setup-ssh-euxfel-gitlab: &setup-ssh-euxfel-gitlab
- eval $(ssh-agent -s) - eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY_GITLAB" | tr -d '\r' | ssh-add - - echo "$SSH_PRIVATE_KEY_GITLAB" | tr -d '\r' | ssh-add -
- mkdir -p ~/.ssh # Our self-hosted runners have persistent home directories, so here we store
- chmod 700 ~/.ssh # the known_hosts file in the temporary project dir and tell git to use a ssh
- ssh-keyscan -p 10022 git.xfel.eu > ~/.ssh/known_hosts # command that uses this hosts file during operations
- export GIT_SSH_COMMAND="ssh UserKnownHostsFile=$CI_PROJECT_DIR/.ssh/known_hosts"
- mkdir -p $CI_PROJECT_DIR/.ssh
- chmod 700 $CI_PROJECT_DIR/.ssh
- ssh-keyscan -p 10022 git.xfel.eu > $CI_PROJECT_DIR/.ssh/known_hosts
checks: checks:
stage: check stage: check
...@@ -31,6 +35,8 @@ pytest: ...@@ -31,6 +35,8 @@ pytest:
only: [merge_requests] only: [merge_requests]
before_script: before_script:
- *setup-ssh-euxfel-gitlab - *setup-ssh-euxfel-gitlab
- ls $CI_PROJECT_DIR/.ssh
- echo $GIT_SSH_COMMAND
script: script:
- python3 -m venv .venv - python3 -m venv .venv
- source .venv/bin/activate - source .venv/bin/activate
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment