From 4e0b3c772bfd9ee4f67960c1d3c4f5082dea706f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20HUGUET?= <remi.huguet@ensiie.fr>
Date: Wed, 9 Oct 2019 10:55:30 +0200
Subject: [PATCH] fix gitci

---
 .gitlab-ci.yml | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 5656a5d..4472c4f 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -5,7 +5,24 @@ ubuntu:18.04
 before_script:
   - apt-get update -qy
   - apt-get install -y lftp
+    - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
+
+  - 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
+  ##
+  - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
+
+  ##
+  ## Create the SSH directory and give it the right permissions
+  ##
+  - mkdir -p ~/.ssh
+  - chmod 700 ~/.ssh
 
 build:
   script:
-    - lftp -e 'set sftp:connect-program "ssh -a -x -i $PRIVATE_KEY"; connect sftp://aeiie@perso.iiens.net; mirror -X .* -X .*/ --reverse --verbose --delete bde.iiens.net/ /home/users/assoces/aeiie/html/web/test; UpdateFinished'
+     - lftp -e 'set sftp:connect-program "ssh -a -x -i $PRIVATE_KEY"; connect sftp://aeiie@perso.iiens.net; mirror -X .* -X .*/ --reverse --verbose --delete bde.iiens.net/ /home/users/assoces/aeiie/html/web/test; UpdateFinished'
-- 
GitLab