Refactor ci pipeline.
This commit is contained in:
parent
5e74238df2
commit
5549821f26
@ -2,7 +2,8 @@ stages:
|
|||||||
- install
|
- install
|
||||||
- build
|
- build
|
||||||
- test
|
- test
|
||||||
- build_and_test
|
|
||||||
|
image: node:15-alpine3.10
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
PROJECT_PATH: "$CI_PROJECT_DIR"
|
PROJECT_PATH: "$CI_PROJECT_DIR"
|
||||||
@ -12,7 +13,6 @@ variables:
|
|||||||
|
|
||||||
install_dependencies:
|
install_dependencies:
|
||||||
stage: install
|
stage: install
|
||||||
image: node:15-alpine3.10
|
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
script:
|
script:
|
||||||
@ -34,7 +34,6 @@ install_dependencies:
|
|||||||
|
|
||||||
build:
|
build:
|
||||||
stage: build
|
stage: build
|
||||||
image: node:15-alpine3.10
|
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
script:
|
script:
|
||||||
@ -58,14 +57,22 @@ build:
|
|||||||
|
|
||||||
test:karma:
|
test:karma:
|
||||||
stage: test
|
stage: test
|
||||||
image: node:15-alpine3.10
|
|
||||||
allow_failure: false
|
allow_failure: false
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
|
before_script:
|
||||||
|
- apk add chromium
|
||||||
|
- export CHROME_BIN=/usr/bin/chromium-browser
|
||||||
script:
|
script:
|
||||||
- npm ng test --code-coverage --progress false --watch false
|
- npm ng test --code-coverage --progress false --watch false --browsers=GitlabChromeHeadless
|
||||||
coverage: '/Lines \W+: (\d+\.\d+)%.*/'
|
coverage: '/Statements\s+:\s\d+.\d+%/'
|
||||||
artifacts:
|
artifacts:
|
||||||
|
name: "tests-and-coverage"
|
||||||
|
reports:
|
||||||
|
junit:
|
||||||
|
- $OUTPUT_PATH/tests/junit-test-results.xml
|
||||||
|
cobertura:
|
||||||
|
- $OUTPUT_PATH/coverage/cobetura-coverage.xml
|
||||||
paths:
|
paths:
|
||||||
- coverage/
|
- coverage/
|
||||||
cache:
|
cache:
|
||||||
@ -78,7 +85,6 @@ test:karma:
|
|||||||
|
|
||||||
test:e2e:
|
test:e2e:
|
||||||
stage: test
|
stage: test
|
||||||
image: node:15-alpine3.10
|
|
||||||
allow_failure: false
|
allow_failure: false
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
@ -94,7 +100,6 @@ test:e2e:
|
|||||||
|
|
||||||
test:nglint:
|
test:nglint:
|
||||||
stage: test
|
stage: test
|
||||||
image: node:15-alpine3.10
|
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
script:
|
script:
|
||||||
@ -106,54 +111,3 @@ test:nglint:
|
|||||||
paths:
|
paths:
|
||||||
- node_modules
|
- node_modules
|
||||||
policy: pull
|
policy: pull
|
||||||
|
|
||||||
build_app:
|
|
||||||
stage: build_and_test
|
|
||||||
image: node:15-alpine3.10
|
|
||||||
tags:
|
|
||||||
- docker
|
|
||||||
script:
|
|
||||||
- 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
|
|
||||||
artifacts:
|
|
||||||
name: "cic-staff-client-pipeline"
|
|
||||||
expire_in: 1 days
|
|
||||||
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:
|
|
||||||
- npm ng lint
|
|
||||||
- npm ng test --code-coverage --watch=false --browsers=GitlabChromeHeadless
|
|
||||||
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
|
|
||||||
|
Loading…
Reference in New Issue
Block a user