.gitlab-ci.yml 2.2 KB
Newer Older
Maxime Lefrançois's avatar
Maxime Lefrançois committed
variables:
    GIT_STRATEGY: fetch
    GIT_DEPTH: 0
Maxime Lefrançois's avatar
Maxime Lefrançois committed
    SAREF_DEV_KEY: <my_private_key>
    SAREF_PORTAL_KEY: <my_private_key>

stages:
  - test
  - build
  - deploy

Maxime Lefrançois's avatar
Maxime Lefrançois committed
test-develop:
  stage: test
  image: openjdk:11-jre
Maxime Lefrançois's avatar
Maxime Lefrançois committed
  script:
Maxime Lefrançois's avatar
Maxime Lefrançois committed
    - curl -L -o saref-pipeline.jar "https://labs.etsi.org/rep/saref/saref-pipeline/-/releases/permalink/latest/downloads/saref-pipeline.jar"
Maxime Lefrançois's avatar
Maxime Lefrançois committed
    - java -jar saref-pipeline.jar develop -s && touch target/success
  allow_failure: true
Maxime Lefrançois's avatar
Maxime Lefrançois committed
  except:
    - /^prerelease-v/
    - /^release-v/
  artifacts:
    when: always
    paths:
      - target/site
Maxime Lefrançois's avatar
Maxime Lefrançois committed
      - target/success
Maxime Lefrançois's avatar
Maxime Lefrançois committed
    reports:
      junit: target/report_output.xml

Maxime Lefrançois's avatar
Maxime Lefrançois committed
test-prerelease:
  stage: test
  image: openjdk:11-jre
Maxime Lefrançois's avatar
Maxime Lefrançois committed
  script:
Maxime Lefrançois's avatar
Maxime Lefrançois committed
    - curl -L -o saref-pipeline.jar "https://labs.etsi.org/rep/saref/saref-pipeline/-/releases/permalink/latest/downloads/saref-pipeline.jar"
Maxime Lefrançois's avatar
Maxime Lefrançois committed
    - java -jar saref-pipeline.jar release -t && touch target/success
  allow_failure: true
  only:
Maxime Lefrançois's avatar
Maxime Lefrançois committed
    - /^prerelease-v/
  artifacts:
    when: always
    paths:
      - target/site
Maxime Lefrançois's avatar
Maxime Lefrançois committed
      - target/success
Maxime Lefrançois's avatar
Maxime Lefrançois committed
    reports:
      junit: target/report_output.xml
Maxime Lefrançois's avatar
Maxime Lefrançois committed

# 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/
Maxime Lefrançois's avatar
Maxime Lefrançois committed

test-release:
  stage: test
  image: openjdk:11-jre
Maxime Lefrançois's avatar
Maxime Lefrançois committed
  script:
Maxime Lefrançois's avatar
Maxime Lefrançois committed
    - curl -L -o saref-pipeline.jar "https://labs.etsi.org/rep/saref/saref-pipeline/-/releases/permalink/latest/downloads/saref-pipeline.jar"
Maxime Lefrançois's avatar
Maxime Lefrançois committed
    - java -jar saref-pipeline.jar release -t
  only:
    - /^release-v/

trigger-release:
  stage: deploy
  only:
    - /^release-v/
  variables:
    SAREF_DEV_KEY: $SAREF_DEV_KEY
    SAREF_PORTAL_KEY: $SAREF_PORTAL_KEY
  trigger:
    project: saref/saref-portal
    branch: master