diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ac4383f7b3abe4a18beab4eb69bff25e6f921169..820facdf1042b8f064468a3a3ec8b8d5faf8a21b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,17 +6,18 @@ before_script: # List installed stuff: - apt list --installed ####- pip install hyperspy tqdm cmocean nose - # Run ssh-agent, "-s" forces generation of Bourne shell (/bin/sh) commands on stdout: - - eval $(ssh-agent -s) - # Add SSH key for jutil to the agent store: - - echo "$SSH_KEY_JUTIL" - - ssh-add <(echo "$SSH_KEY_JUTIL") + # Create SSH configuration directory if necessary: + - mkdir -p --mode=700 ~/.ssh/ + # Add SSH key for jutil: + - echo "$SSH_KEY_JUTIL" > ~/.ssh/jutil_key + - chmod 400 ~/.ssh/jutil_key + # Configure SSH to use ~/.ssh/jutil_key for iffgit.fz-juelich.de: + - echo -e "Host iffgit.fz-juelich.de\n\tIdentityFile ~/.ssh/jutil_key\n\n" > ~/.ssh/config # For Docker builds disable host key checking. Be aware that by adding that # you are suspectible to man-in-the-middle attacks. # WARNING: Use this only with the Docker executor, if you use it with shell # you will overwrite your user's SSH config. - - mkdir -p ~/.ssh - - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' + - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" >> ~/.ssh/config' - pip install git+ssh://gitlab@iffgit.fz-juelich.de/unger/jutil.git - echo "Done"