2020-11-25 09:49:35 +01:00
|
|
|
stages:
|
|
|
|
- install
|
2020-11-25 15:58:36 +01:00
|
|
|
- build
|
|
|
|
- test
|
2020-11-25 16:01:42 +01:00
|
|
|
- build_and_test
|
2020-11-25 09:49:35 +01:00
|
|
|
|
2020-11-25 11:26:00 +01:00
|
|
|
variables:
|
|
|
|
PROJECT_PATH: "$CI_PROJECT_DIR"
|
2020-11-25 15:58:36 +01:00
|
|
|
APP_OUTPUT_PATH: "$CI_PROJECT_DIR/dist/cic-staff-client"
|
|
|
|
OUTPUT_PATH: "$CI_PROJECT_DIR/dist"
|
|
|
|
CLI_VERSION: 10.2.0
|
2020-11-25 11:26:00 +01:00
|
|
|
|
2020-11-25 09:49:35 +01:00
|
|
|
install_dependencies:
|
|
|
|
stage: install
|
2020-11-25 09:34:04 +01:00
|
|
|
image: node:15-alpine3.10
|
|
|
|
tags:
|
|
|
|
- docker
|
|
|
|
script:
|
2020-12-28 12:02:37 +01:00
|
|
|
- npm install -g @angular/cli
|
2020-11-25 09:49:35 +01:00
|
|
|
- npm install
|
|
|
|
cache:
|
|
|
|
key:
|
|
|
|
files:
|
|
|
|
- package-lock.json
|
|
|
|
paths:
|
|
|
|
- node_modules
|
|
|
|
policy: pull
|
|
|
|
only:
|
|
|
|
refs:
|
|
|
|
- merge_requests
|
|
|
|
- master
|
|
|
|
changes:
|
|
|
|
- package-lock.json
|
2020-11-25 11:26:00 +01:00
|
|
|
|
2020-11-25 16:01:42 +01:00
|
|
|
build:
|
|
|
|
stage: build
|
2020-12-28 12:23:16 +01:00
|
|
|
image: node:15-alpine3.10
|
2020-11-25 16:01:42 +01:00
|
|
|
tags:
|
|
|
|
- docker
|
|
|
|
script:
|
2020-12-28 12:23:16 +01:00
|
|
|
- npm ng build --prod
|
|
|
|
after_script:
|
|
|
|
- mv $PROJECT_PATH/nginx.conf $PROJECT_PATH/default.conf
|
|
|
|
- cp $PROJECT_PATH/default.conf $APP_OUTPUT_PATH
|
|
|
|
- cp $PROJECT_PATH/Dockerfile $APP_OUTPUT_PATH
|
2020-11-25 16:01:42 +01:00
|
|
|
artifacts:
|
2020-12-28 12:23:16 +01:00
|
|
|
name: "cic-staff-client-pipeline"
|
2020-11-25 16:01:42 +01:00
|
|
|
expire_in: 1 days
|
|
|
|
paths:
|
2020-12-28 12:23:16 +01:00
|
|
|
- $APP_OUTPUT_PATH
|
|
|
|
cache:
|
|
|
|
key:
|
|
|
|
files:
|
|
|
|
- package-lock.json
|
|
|
|
paths:
|
|
|
|
- node_modules
|
|
|
|
policy: pull
|
|
|
|
|
|
|
|
test:karma:
|
|
|
|
stage: test
|
|
|
|
image: node:15-alpine3.10
|
|
|
|
allow_failure: false
|
|
|
|
tags:
|
|
|
|
- docker
|
|
|
|
script:
|
|
|
|
- npm ng test --code-coverage --progress false --watch false
|
|
|
|
coverage: '/Lines \W+: (\d+\.\d+)%.*/'
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- coverage/
|
|
|
|
cache:
|
|
|
|
key:
|
|
|
|
files:
|
|
|
|
- package-lock.json
|
|
|
|
paths:
|
|
|
|
- node_modules
|
|
|
|
policy: pull
|
|
|
|
|
|
|
|
test:e2e:
|
|
|
|
stage: test
|
|
|
|
image: node:15-alpine3.10
|
|
|
|
allow_failure: false
|
|
|
|
tags:
|
|
|
|
- docker
|
|
|
|
script:
|
|
|
|
- npm ng e2e
|
2020-12-28 11:31:35 +01:00
|
|
|
cache:
|
|
|
|
key:
|
|
|
|
files:
|
|
|
|
- package-lock.json
|
|
|
|
paths:
|
|
|
|
- node_modules
|
|
|
|
policy: pull
|
2020-11-25 16:01:42 +01:00
|
|
|
|
2020-12-28 12:23:16 +01:00
|
|
|
test:nglint:
|
|
|
|
stage: test
|
|
|
|
image: node:15-alpine3.10
|
|
|
|
tags:
|
|
|
|
- docker
|
|
|
|
script:
|
|
|
|
- npm ng lint
|
|
|
|
cache:
|
|
|
|
key:
|
|
|
|
files:
|
|
|
|
- package-lock.json
|
|
|
|
paths:
|
|
|
|
- node_modules
|
|
|
|
policy: pull
|
2020-11-25 16:01:42 +01:00
|
|
|
|
2020-11-25 11:26:00 +01:00
|
|
|
build_app:
|
|
|
|
stage: build_and_test
|
|
|
|
image: node:15-alpine3.10
|
|
|
|
tags:
|
|
|
|
- docker
|
|
|
|
script:
|
2020-12-28 12:12:10 +01:00
|
|
|
- npm ng build --prod
|
2020-12-28 12:16:10 +01:00
|
|
|
after_script:
|
|
|
|
- mv $PROJECT_PATH/nginx.conf $PROJECT_PATH/default.conf
|
|
|
|
- cp $PROJECT_PATH/default.conf $APP_OUTPUT_PATH
|
|
|
|
- cp $PROJECT_PATH/Dockerfile $APP_OUTPUT_PATH
|
2020-11-25 11:26:00 +01:00
|
|
|
artifacts:
|
|
|
|
name: "cic-staff-client-pipeline"
|
2020-11-25 17:53:41 +01:00
|
|
|
expire_in: 1 days
|
2020-11-25 11:26:00 +01:00
|
|
|
paths:
|
|
|
|
- $APP_OUTPUT_PATH
|
|
|
|
cache:
|
|
|
|
key:
|
|
|
|
files:
|
|
|
|
- package-lock.json
|
|
|
|
paths:
|
|
|
|
- node_modules
|
|
|
|
policy: pull
|
|
|
|
|
|
|
|
test_app:
|
|
|
|
stage: build_and_test
|
|
|
|
image: node:15-alpine3.10
|
|
|
|
tags:
|
|
|
|
- docker
|
|
|
|
before_script:
|
|
|
|
- apk add chromium
|
|
|
|
- export CHROME_BIN=/usr/bin/chromium-browser
|
|
|
|
script:
|
2020-12-28 12:16:10 +01:00
|
|
|
- npm ng lint
|
|
|
|
- npm ng test --code-coverage --watch=false --browsers=GitlabChromeHeadless
|
2020-11-25 11:26:00 +01:00
|
|
|
coverage: '/Statements\s+:\s\d+.\d+%/'
|
|
|
|
artifacts:
|
|
|
|
name: "tests-and-coverage"
|
|
|
|
reports:
|
|
|
|
junit:
|
|
|
|
- $OUTPUT_PATH/tests/junit-test-results.xml
|
|
|
|
cobertura:
|
|
|
|
- $OUTPUT_PATH/coverage/cobetura-coverage.xml
|
|
|
|
cache:
|
|
|
|
key:
|
|
|
|
files:
|
|
|
|
- package-lock.json
|
|
|
|
paths:
|
|
|
|
- node_modules
|
|
|
|
policy: pull
|