Commit ce38b123 authored by Maxime Lefrançois's avatar Maxime Lefrançois
Browse files

updated gitlab

parent cfaffab9
Loading
Loading
Loading
Loading
+48 −5
Original line number Original line Diff line number Diff line
image: maximelefrancois86/alpine-ssh-rsync

variables:
variables:
    SAREF_PORTAL_KEY: <my_private_key>
    SAREF_PORTAL_KEY: <my_private_key>


@@ -9,9 +7,54 @@ before_script:
  - mkdir -p ~/.ssh
  - 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'


build:
stages:
  - pipeline
  - staging
  - release

prepare-prerelease:
  image: openjdk:1.8
  stage: pipeline
  allow_failure: true
  script:
    - curl -L -o saref-pipeline.jar "https://gitlab.emse.fr/saref/saref-pipeline/-/jobs/artifacts/master/raw/target/saref-pipeline.jar?job=build"
    - java -jar saref-pipeline.jar portal && touch target/success
  except: master
  artifacts:
    paths:
      - target/site
    reports:
      junit: target/report_output.xml

prepare-release:
  image: openjdk:1.8
  stage: pipeline
  script:
    - curl -L -o saref-pipeline.jar "https://gitlab.emse.fr/saref/saref-pipeline/-/jobs/artifacts/master/raw/target/saref-pipeline.jar?job=build"
    - java -jar saref-pipeline.jar portal && touch target/success
  only: master
  artifacts:
    paths:
      - target/site
    reports:
      junit: target/report_output.xml

staging:
  image: maximelefrancois86/alpine-ssh-rsync
  stage: staging
  script:
    - scp -pr '-P 29419' target/site saref-portal@saref.etsi.org:~/staging/$CI_PIPELINE_ID
    - echo "\tSAREF staging portal  https\://saref.etsi.org/staging/$CI_PIPELINE_ID/" 
    - exit $(test -f target/success) $?

deploy:
  image: maximelefrancois86/alpine-ssh-rsync
  stage: release
  when: manual
  script:
  script:
   - echo "nameserver 8.8.8.8" > /etc/resolv.conf
    - rsync -rtcv -e 'exssh -p 29419' error-documents saref-portal@saref.etsi.org:~/error-documents
   - rsync -rtcv -e 'ssh -p 29419' error-documents saref-portal@saref.etsi.org:~/error-documents
    - rsync -rtcv -e 'ssh -p 29419' target/site saref-portal@saref.etsi.org:~/site
    - scp -pr '-P 29419' target/dataset saref-portal@saref.etsi.org:~/dataset-new
    - ssh saref-portal@saref.etsi.org "rm ~/dataset && mv ~/dataset-new ~/dataset"
  only:
  only:
   - master 
   - master