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 5.72 KiB
image: sharing-codeability.uibk.ac.at:5051/sharing/codeability-sharing-platform/root-jhipster

cache: &global_cache
  key: '$CI_COMMIT_REF_SLUG'
  paths:
    - .maven/
    - .npm/
  policy: pull-push

stages:
  - lint
  # - build
  # - test
  # - analyze
  # - release
  # - deploy

before_script:
  - export NG_CLI_ANALYTICS="false"
  - export MAVEN_USER_HOME=`pwd`/.maven
  - npm ci --cache .npm --prefer-offline

pmdCheckstylePrettierLint:
  stage: lint
  cache:
    # inherit all global cache settings
    <<: *global_cache
    # override the policy
    policy: pull
  when: always
  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"'
    # - 'chmod u+x "pmd-bin-$VERSION/bin/run.sh"'
    # - SUCCESS=true
    # - echo "Running PMD"
    # - '"pmd-bin-$VERSION/bin/run.sh" pmd -d src/main/java -f textcolor -R pmd_rules.xml 2>&1 | tee pmd.log || SUCCESS=false'
    - pmd pmd -d src/main/java -f textcolor -R pmd_rules.xml 2>&1 | tee pmd.log || SUCCESS=false'

    - echo "Running checkstyle"
    - ./mvnw -ntp checkstyle:check -Dmaven.repo.local=$MAVEN_USER_HOME || SUCCESS=false
    - echo "Running prettier"
    - npm install
    - npm run prettier:check
    - echo "Running eslint"
    - 'npm run lint | tee lint.log'
    - "! grep -qE '✖ [0-9]+ problem' lint.log || SUCCESS=false"
    - $SUCCESS
  needs: []
  artifacts:
    when: on_failure
    expire_in: 30 days
    paths:
      - pmd.log
# maven-compile:
#   stage: build
#   script:
#     - ./mvnw -ntp compile -P-webapp -Dmaven.repo.local=$MAVEN_USER_HOME
#   artifacts:
#     paths:
#       - target/classes/
#       - target/generated-sources/
#     expire_in: 15 days
#   needs: []

# maven-test:
#   # DinD service is required for Testcontainers
#   services:
#     - docker:20-dind