.gitlab-ci.yml 1.65 KB
Newer Older
Cypres TAC's avatar
Cypres TAC committed
1
image: maven:3.6-jdk-11
Merisier Tac's avatar
Merisier Tac committed
2 3 4 5

stages:
  - build
  - deploy
6
  - testjs
Kumquat Orange's avatar
Kumquat Orange committed
7
  - buildjs
8
  
Merisier Tac's avatar
Merisier Tac committed
9
build:
Merisier Tac's avatar
Merisier Tac committed
10
  stage: build
Merisier Tac's avatar
Merisier Tac committed
11 12
  tags:
    - ci
Merisier Tac's avatar
Merisier Tac committed
13
  script:
Cypres TAC's avatar
Cypres TAC committed
14
    - cd CLEA-lib/java
Merisier Tac's avatar
Merisier Tac committed
15 16
    # build all (for other phase such as docker) but skip tests
    - mvn -DskipTests=true package
Merisier Tac's avatar
Merisier Tac committed
17 18
  artifacts:
    paths:
Cypres TAC's avatar
Cypres TAC committed
19
      - CLEA-lib/java/target/*.jar
Merisier Tac's avatar
Merisier Tac committed
20

Merisier Tac's avatar
Merisier Tac committed
21 22 23 24 25
test:
  stage: build
  tags:
    - ci
  script:
Cypres TAC's avatar
Cypres TAC committed
26
    - cd CLEA-lib/java
Merisier Tac's avatar
Merisier Tac committed
27 28 29
    - mvn verify
  artifacts:
    paths:
Cypres TAC's avatar
Cypres TAC committed
30
      - CLEA-lib/java/target/*.jar
Merisier Tac's avatar
Merisier Tac committed
31 32

deploy:
Merisier Tac's avatar
Merisier Tac committed
33
  stage: deploy
Merisier Tac's avatar
Merisier Tac committed
34 35
  tags:
    - ci
Merisier Tac's avatar
Merisier Tac committed
36
  script:
Cypres TAC's avatar
Cypres TAC committed
37
    - cd CLEA-lib/java
Cypres TAC's avatar
Cypres TAC committed
38
    - mvn $MAVEN_CLI_OPTS -DskipTests=true  -DnexusReleasesUrl=$CI_SERVER_URL/api/v4/projects/$CI_PROJECT_ID/packages/maven -DnexusSnapshotsUrl=$CI_SERVER_URL/api/v4/projects/$CI_PROJECT_ID/packages/maven -s ../../.gitlab-ci/ci_settings.xml deploy
Merisier Tac's avatar
Merisier Tac committed
39 40
  only:
    - master
Merisier Tac's avatar
Merisier Tac committed
41
    - tags
Kumquat Orange's avatar
Kumquat Orange committed
42

43 44 45
testjs:
  stage: testjs
  before_script:
46
    #Install  node and npm #
47
    - apt-get install -y curl && curl -sL https://deb.nodesource.com/setup_15.x | bash - && apt-get install -y nodejs && curl -L https://www.npmjs.com/install.sh | sh 
48 49 50 51
    #Install Latest Google chrome package on system for front test#
    - apt-get install -y chromium
    #Install Latest firefox package on system for front test#
    - apt-get install -y firefox-esr
52 53 54 55
  tags:
    - ci
  script:
    - cd CLEA-lib/js
Kumquat Orange's avatar
Kumquat Orange committed
56 57
    - pwd || true
    - cp ../java/target/clea-crypto-0.0.1-SNAPSHOT-jar-with-dependencies.jar ./clea-crypto.jar
58 59
    - export CHROME_BIN=chromium
    - export FIREFOX_BIN=firefox-esr
60 61 62 63
    - npm install
    - npm test
    - npm run testcrypto

Kumquat Orange's avatar
Kumquat Orange committed
64 65 66 67 68 69 70
buildjs:
  stage: buildjs
  image: node:15.13.0
  tags:
    - ci
  script:
    - cd CLEA-lib/js
Kumquat Orange's avatar
Kumquat Orange committed
71
    - npm install
Kumquat Orange's avatar
Kumquat Orange committed
72 73 74
    - npm run build
    - ls dist