Newer
Older

Trygve Jørgensen
committed
stages:
- lint_and_format
- build
- test
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- node_modules/
install:
stage: install
script:
artifacts:
paths:
- node_modules/
format-code:
stage: lint_and_format
script:
- npm run format-test
lint-code:
stage: lint_and_format
script:
- npm run lint
stage: build
script:
- npm run type-check
- npm run build
unit-tests:

Trygve Jørgensen
committed
stage: test
script:
- npm run test:unit
test:e2e:
image: cypress/browsers:node16.14.2-slim-chrome100-ff99-edge
- npm ci --cache .npm --prefer-offline
- npx cypress verify
dependencies:
- install
test-coverage:
stage: test
script:
- npm run test:coverage
include:
- template: SAST.gitlab-ci.yml
sast:
stage: security_scan
script:
- echo "Running SAST..."
deploy:
stage: deploy
image: docker:latest
tags:
- dind
services:
- name: docker:dind
variables:
DOCKER_DRIVER: overlay2
DOCKER_IMAGE_NAME: $CI_REGISTRY_USER/idatt2106_2024_02_frontend-app
DOCKER_TLS_CERTDIR: ""
DOCKER_HOST: tcp://docker:2375
script:
- echo "$CI_REGISTRY_PASSWORD" | docker login --username $CI_REGISTRY_USER --password-stdin
- docker build -t $DOCKER_IMAGE_NAME:latest .
- docker push $DOCKER_IMAGE_NAME:latest