From 5e74238df22f21dbc3fb0d1fe13f333046b508b6 Mon Sep 17 00:00:00 2001 From: Spencer Ofwiti Date: Mon, 28 Dec 2020 14:23:16 +0300 Subject: [PATCH] Refactor ci pipeline. --- .gitlab-ci.yml | 113 +++++++++++++++++++++++++------------------------ 1 file changed, 58 insertions(+), 55 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8a1b5f8..738e016 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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