refactor(npm): update npm templates

This commit is contained in:
Alex Munoz 2022-05-24 14:14:37 +02:00 committed by Marcel Feix
parent c96998380c
commit 36efdb707b
No known key found for this signature in database
GPG Key ID: 04D016E104A25F03
6 changed files with 29 additions and 43 deletions

View File

@ -1,22 +1,12 @@
.npm-build:
image: $NODE_IMAGE
stage: build
variables:
ADDITIONAL_GLOBAL_PACKAGES: ""
before_script:
- >
if [ "$ADDITIONAL_GLOBAL_PACKAGES" != "" ]; then
npm install -g $ADDITIONAL_GLOBAL_PACKAGES
if [ "$FRONTEND_DIR" != "" ]; then
cd $FRONTEND_DIR
fi
#Todo this needs Testing!!
- >
if [ "$CI_COMMIT_TAG" != "" ]; then
npm --no-git-tag-version version from-git
fi
#Testing END
script:
- "cd $FRONTEND_DIR"
- npm install
- npm run build
artifacts:
expire_in: 2 weeks

View File

@ -1,16 +1,13 @@
.npm-dependencies:
image: $NODE_IMAGE
stage: dependencies
variables:
ADDITIONAL_GLOBAL_PACKAGES: ""
before_script:
- >
if [ "$ADDITIONAL_GLOBAL_PACKAGES" != "" ]; then
npm install -g $ADDITIONAL_GLOBAL_PACKAGES
if [ "$FRONTEND_DIR" != "" ]; then
cd $FRONTEND_DIR
fi
script:
- "cd $FRONTEND_DIR"
- npm install
- npm ci
artifacts:
expire_in: 1 days
paths:

View File

@ -0,0 +1,10 @@
.npm-e2e:
image: $NODE_IMAGE
stage: verify
before_script:
- >
if [ "$FRONTEND_DIR" != "" ]; then
cd $FRONTEND_DIR
fi
script:
- npm run e2e

View File

@ -1,18 +1,10 @@
.npm-lint:
image: $NODE_IMAGE
stage: verify
variables:
ADDITIONAL_GLOBAL_PACKAGES: "eslint"
before_script:
- >
if [ "$ADDITIONAL_GLOBAL_PACKAGES" != "" ]; then
npm install -g $ADDITIONAL_GLOBAL_PACKAGES
if [ "$FRONTEND_DIR" != "" ]; then
cd $FRONTEND_DIR
fi
script:
- "cd $FRONTEND_DIR"
- npm run lint
# artifacts: todo add lint results in artifact if possible
# expire_in: 2 weeks
# when: always
# paths:
# - dist/*

View File

@ -0,0 +1,10 @@
.npm-test:
image: $NODE_IMAGE
stage: test
before_script:
- >
if [ "$FRONTEND_DIR" != "" ]; then
cd $FRONTEND_DIR
fi
script:
- npm run test

View File

@ -1,13 +0,0 @@
.npm-verify:
image: $NODE_IMAGE
stage: verify
variables:
ADDITIONAL_GLOBAL_PACKAGES: "karma"
before_script:
- >
if [ "$ADDITIONAL_GLOBAL_PACKAGES" != "" ]; then
npm install -g $ADDITIONAL_GLOBAL_PACKAGES
fi
script:
- "cd $FRONTEND_DIR"
- npm run test-ci