Skip to content
Snippets Groups Projects
This GitLab CI configuration is valid. Learn more
Forked from an inaccessible project.
.gitlab-ci.yml 1.55 KiB
variables:
  BUILD_DIR: dist

stages:
  - test
  - codestyle
  - build
  - deploy

cache:
  key: ${CI_COMMIT_REF_SLUG}
  paths:
    - node_modules/

eslint:
  stage: codestyle
  tags:
    - nodejs
  allow_failure: true
  dependencies: []
  script:
    - npm install
    - node_modules/eslint/bin/eslint.js -c .eslintrc.json --ext .ts ./src

unit_tests:
 stage: test
 tags:
   - nodejs
 allow_failure: false
 dependencies: []
 artifacts:
   paths:
     - coverage
 script:
   - npm i
   - npm test

sonar:
  stage: codestyle
  only:
    - staging
  tags:
    - sonar-cli
  allow_failure: true
  dependencies:
    - unit_tests
  script:
    - npm i
    - sonar-scanner -Dsonar.login=$SONAR_TOKEN -Dsonar.host.url=https://scm.thm.de/sonar/

ngbuild:
  stage: build
  tags:
    - angular
  allow_failure: false
  dependencies: []
  script:
    - npm install -g @angular/cli
    - npm install
    - ng build --prod --aot
  artifacts:
    paths:
      - "$BUILD_DIR"

deploy_staging:
  stage: deploy
  only:
    - staging
  tags:
    - ssh