feat(NPM): Add Additional Packages install to NPM script

This commit is contained in:
Marcel Feix 2022-05-13 15:44:09 +02:00
parent 75799e32fc
commit b34da659e9
No known key found for this signature in database
GPG Key ID: 04D016E104A25F03
4 changed files with 20 additions and 8 deletions

View File

@ -4,7 +4,10 @@
variables: variables:
ADDITIONAL_GLOBAL_PACKAGES: "" ADDITIONAL_GLOBAL_PACKAGES: ""
before_script: before_script:
- npm install -g $ADDITIONAL_GLOBAL_PACKAGES - >
if [ "$ADDITIONAL_GLOBAL_PACKAGES" != "" ]; then
npm install -g $ADDITIONAL_GLOBAL_PACKAGES
fi
#Todo this needs Testing!! #Todo this needs Testing!!
- > - >
if [ "$CI_COMMIT_TAG" != "" ]; then if [ "$CI_COMMIT_TAG" != "" ]; then
@ -12,6 +15,7 @@
fi fi
#Testing END #Testing END
script: script:
- "cd $FRONTEND_DIR"
- npm install - npm install
- npm run build - npm run build
artifacts: artifacts:

View File

@ -4,7 +4,10 @@
variables: variables:
ADDITIONAL_GLOBAL_PACKAGES: "" ADDITIONAL_GLOBAL_PACKAGES: ""
before_script: before_script:
- npm install -g $ADDITIONAL_GLOBAL_PACKAGES - >
if [ "$ADDITIONAL_GLOBAL_PACKAGES" != "" ]; then
npm install -g $ADDITIONAL_GLOBAL_PACKAGES
fi
script: script:
- "cd $FRONTEND_DIR" - "cd $FRONTEND_DIR"
- npm install - npm install

View File

@ -2,12 +2,14 @@
image: $NODE_IMAGE image: $NODE_IMAGE
stage: verify stage: verify
variables: variables:
ADDITIONAL_GLOBAL_PACKAGES: "" ADDITIONAL_GLOBAL_PACKAGES: "eslint"
before_script: before_script:
- npm install -g $ADDITIONAL_GLOBAL_PACKAGES - >
- "cd $FRONTEND_DIR" if [ "$ADDITIONAL_GLOBAL_PACKAGES" != "" ]; then
- npm install -g eslint npm install -g $ADDITIONAL_GLOBAL_PACKAGES
fi
script: script:
- "cd $FRONTEND_DIR"
- npm run lint - npm run lint
# artifacts: todo add lint results in artifact if posible # artifacts: todo add lint results in artifact if posible
# expire_in: 2 weeks # expire_in: 2 weeks

View File

@ -4,7 +4,10 @@
variables: variables:
ADDITIONAL_GLOBAL_PACKAGES: "karma" ADDITIONAL_GLOBAL_PACKAGES: "karma"
before_script: before_script:
- npm install -g $ADDITIONAL_GLOBAL_PACKAGES - >
if [ "$ADDITIONAL_GLOBAL_PACKAGES" != "" ]; then
npm install -g $ADDITIONAL_GLOBAL_PACKAGES
fi
script: script:
- cd $FRONTEND_DIR - "cd $FRONTEND_DIR"
- npm run test-ci - npm run test-ci