From b34da659e9f2c24d2e77835af23dcb2ddecfd901 Mon Sep 17 00:00:00 2001 From: Marcel Feix Date: Fri, 13 May 2022 15:44:09 +0200 Subject: [PATCH] feat(NPM): Add Additional Packages install to NPM script --- templates/npm/npm-build.gitlab-ci.yml | 6 +++++- templates/npm/npm-dependencies.gitlab-ci.yml | 5 ++++- templates/npm/npm-lint.gitlab-ci.yml | 10 ++++++---- templates/npm/npm-test.gitlab-ci.yml | 7 +++++-- 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/templates/npm/npm-build.gitlab-ci.yml b/templates/npm/npm-build.gitlab-ci.yml index 905b357..0b9405a 100644 --- a/templates/npm/npm-build.gitlab-ci.yml +++ b/templates/npm/npm-build.gitlab-ci.yml @@ -4,7 +4,10 @@ variables: ADDITIONAL_GLOBAL_PACKAGES: "" before_script: - - npm install -g $ADDITIONAL_GLOBAL_PACKAGES + - > + if [ "$ADDITIONAL_GLOBAL_PACKAGES" != "" ]; then + npm install -g $ADDITIONAL_GLOBAL_PACKAGES + fi #Todo this needs Testing!! - > if [ "$CI_COMMIT_TAG" != "" ]; then @@ -12,6 +15,7 @@ fi #Testing END script: + - "cd $FRONTEND_DIR" - npm install - npm run build artifacts: diff --git a/templates/npm/npm-dependencies.gitlab-ci.yml b/templates/npm/npm-dependencies.gitlab-ci.yml index 758313d..d7f40c5 100644 --- a/templates/npm/npm-dependencies.gitlab-ci.yml +++ b/templates/npm/npm-dependencies.gitlab-ci.yml @@ -4,7 +4,10 @@ variables: ADDITIONAL_GLOBAL_PACKAGES: "" before_script: - - npm install -g $ADDITIONAL_GLOBAL_PACKAGES + - > + if [ "$ADDITIONAL_GLOBAL_PACKAGES" != "" ]; then + npm install -g $ADDITIONAL_GLOBAL_PACKAGES + fi script: - "cd $FRONTEND_DIR" - npm install diff --git a/templates/npm/npm-lint.gitlab-ci.yml b/templates/npm/npm-lint.gitlab-ci.yml index bddd8ac..18ad525 100644 --- a/templates/npm/npm-lint.gitlab-ci.yml +++ b/templates/npm/npm-lint.gitlab-ci.yml @@ -2,12 +2,14 @@ image: $NODE_IMAGE stage: verify variables: - ADDITIONAL_GLOBAL_PACKAGES: "" + ADDITIONAL_GLOBAL_PACKAGES: "eslint" before_script: - - npm install -g $ADDITIONAL_GLOBAL_PACKAGES - - "cd $FRONTEND_DIR" - - npm install -g eslint + - > + if [ "$ADDITIONAL_GLOBAL_PACKAGES" != "" ]; then + npm install -g $ADDITIONAL_GLOBAL_PACKAGES + fi script: + - "cd $FRONTEND_DIR" - npm run lint # artifacts: todo add lint results in artifact if posible # expire_in: 2 weeks diff --git a/templates/npm/npm-test.gitlab-ci.yml b/templates/npm/npm-test.gitlab-ci.yml index 922c992..ab0d48f 100644 --- a/templates/npm/npm-test.gitlab-ci.yml +++ b/templates/npm/npm-test.gitlab-ci.yml @@ -4,7 +4,10 @@ variables: ADDITIONAL_GLOBAL_PACKAGES: "karma" before_script: - - npm install -g $ADDITIONAL_GLOBAL_PACKAGES + - > + if [ "$ADDITIONAL_GLOBAL_PACKAGES" != "" ]; then + npm install -g $ADDITIONAL_GLOBAL_PACKAGES + fi script: - - cd $FRONTEND_DIR + - "cd $FRONTEND_DIR" - npm run test-ci \ No newline at end of file