Refactor ci pipeline.

This commit is contained in:
Spencer Ofwiti 2020-12-28 14:23:16 +03:00
parent 99a0c39eb7
commit 5e74238df2

View File

@ -34,17 +34,20 @@ install_dependencies:
build:
stage: build
image: trion/ng-cli
image: node:15-alpine3.10
tags:
- docker
before_script:
- npm ci
script:
- ng build --prod
- 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:
- dist/cic-staff-client
- $APP_OUTPUT_PATH
cache:
key:
files:
@ -53,56 +56,56 @@ build:
- node_modules
policy: pull
#test:karma:
# stage: test
# image: trion/ng-cli-karma
# allow_failure: false
# tags:
# - docker
# script:
# - 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: trion/ng-cli-e2e
# allow_failure: false
# tags:
# - docker
# script:
# - ng e2e
# cache:
# key:
# files:
# - package-lock.json
# paths:
# - node_modules
# policy: pull
#
#test:nglint:
# stage: test
# image: trion/ng-cli
# tags:
# - docker
# script:
# - ng lint
# 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
cache:
key:
files:
- package-lock.json
paths:
- node_modules
policy: pull
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
build_app:
stage: build_and_test