This is the codeAbility Sharing Platform! Learn more about the codeAbility Sharing Platform.

Skip to content
Snippets Groups Projects
This GitLab CI configuration is valid. Learn more
.gitlab-ci.yml 3.86 KiB
image: jhipster/jhipster:v7.6.0

cache:
  key: '$CI_COMMIT_REF_NAME'
  paths:
    - .maven/
stages:
  - lint
  - build
  - test
  - analyze
  - package
  - release
  - deploy

before_script:
  - export NG_CLI_ANALYTICS="false"
  - export MAVEN_USER_HOME=`pwd`/.maven

pmd:
  stage: lint
  cache: {}
  allow_failure: true
  when: always
  before_script:
    - 'export VERSION="6.40.0"'
    - 'wget "https://github.com/pmd/pmd/releases/download/pmd_releases%2F$VERSION/pmd-bin-$VERSION.zip"'
    - 'jar -xf "pmd-bin-$VERSION.zip"'
  script:
    - '"pmd-bin-$VERSION/bin/run.sh" pmd -d src/main/java -f textcolor -R pmd_rules.xml 2>&1 | tee pmd.log'
  needs: []
  artifacts:
    when: on_failure
    paths:
      - pmd.log

checkstyle:
  stage: lint
  script:
    - ./mvnw -ntp checkstyle:check -Dmaven.repo.local=$MAVEN_USER_HOME
  needs: []

prettier:
  stage: lint
  cache: {}
  script:
    - npm install
    - npm run prettier:check
  allow_failure: true
  needs: []

eslint:
  stage: lint
  cache: {}
  script:
    - npm install
    # eslint exits 0 on warnings, this is a workaround to exit 1 when warnings are present.
    - 'npm run lint | tee lint.log'
    - "! grep -qE '✖ [0-9]+ problem' lint.log"
  allow_failure: true
  needs: []

maven-compile:
  stage: build
  script:
    - ./mvnw -ntp compile -P-webapp -Dmaven.repo.local=$MAVEN_USER_HOME
  artifacts:
    paths:
      - target/classes/
      - target/generated-sources/