From 25d3ed66393bec2c8d9f76c05c0e2e356f84ff29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joan=20Vallv=C3=A9=20Navarro?= <jvallve@iri.upc.edu> Date: Tue, 5 Dec 2023 16:36:56 +0100 Subject: [PATCH] Upload New File --- .ci_templates/.preliminaries.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .ci_templates/.preliminaries.yml diff --git a/.ci_templates/.preliminaries.yml b/.ci_templates/.preliminaries.yml new file mode 100644 index 000000000..c0f9a861e --- /dev/null +++ b/.ci_templates/.preliminaries.yml @@ -0,0 +1,25 @@ +.preliminaries_script: + + ## Install ssh-agent if not already installed, it is required by Docker. + ## (change apt-get to yum if you use an RPM-based image) + - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )' + + ## Run ssh-agent (inside the build environment) + - eval $(ssh-agent -s) + + ## Add the SSH key stored in SSH_PRIVATE_KEY variable to the agent store + ## We're using tr to fix line endings which makes ed25519 keys work + ## without extra base64 encoding. + ## https://gitlab.com/gitlab-examples/ssh-private-key/issues/1#note_48526556 + - mkdir -p ~/.ssh + - chmod 700 ~/.ssh + - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null + # - echo "$SSH_KNOWN_HOSTS" > $HOME/.ssh/known_hosts + - ssh-keyscan -H -p 2202 gitlab.iri.upc.edu >> $HOME/.ssh/known_hosts + + # update apt + - apt-get update + + # create 'ci_deps' folder (if not exists) + - cd ${CI_PROJECT_DIR} + - mkdir -pv ci_deps \ No newline at end of file -- GitLab