From 47893985c6c563558dffde048357f23a25e9d23c Mon Sep 17 00:00:00 2001
From: Maxime <maxime.lefrancois@emse.fr>
Date: Fri, 24 May 2024 15:15:33 +0200
Subject: [PATCH] update ci/cd

---
 .gitlab-ci.yml | 33 +++++++++++++++++----------------
 1 file changed, 17 insertions(+), 16 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 8eb754a..21c8c42 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -3,13 +3,13 @@ variables:
     GIT_DEPTH: 0
     SAREF_DEV_KEY: <my_private_key>
     SAREF_PORTAL_KEY: <my_private_key>
+    SAREF_PORT: <port>
 
 stages:
   - test
   - build
   - deploy
 
-
 test-develop:
   stage: test
   image: openjdk:11-jre
@@ -45,21 +45,22 @@ test-prerelease:
     reports:
       junit: target/report_output.xml
 
-# deploy-report:
-#   stage: deploy
-#   image: alpine:latest
-#   script:
-#     - apk update
-#     - apk add openssh
-#     - eval $(ssh-agent -s)
-#     - ssh-add <(echo "$SAREF_DEV_KEY")
-#     - mkdir -p ~/.ssh
-#     - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
-#     - scp -P 29419 -pr target/site saref-dev@saref.etsi.org:~/snapshot/$CI_PIPELINE_ID
-#     - echo "SAREF pipeline report  https://saref.etsi.org/snapshot/$CI_PIPELINE_ID/report.html" 
-#     - exit $(test -f target/success) $?
-#   except:
-#     - /^release-v/
+deploy-report:
+  stage: deploy
+  image: alpine:latest
+  script:
+    - apk update
+    - apk add openssh
+    - echo "172.29.10.32    saref.etsi.org" >> /etc/hosts
+    - eval $(ssh-agent -s)
+    - ssh-add <(echo "$SAREF_DEV_KEY")
+    - mkdir -p ~/.ssh
+    - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
+    - scp -P $SAREF_PORT -O -pr target/site saref-dev@saref.etsi.org:~/snapshot/$CI_PIPELINE_ID
+    - echo "SAREF pipeline report  https://saref.etsi.org/snapshot/$CI_PIPELINE_ID/report.html" 
+    - exit $(test -f target/success) $?
+  except:
+    - /^release-v/
 
 test-release:
   stage: test
-- 
GitLab