diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 575787d4eef2001fd0977404edb2a1ef25f6e298..7fd4d8eb38693b9ee58b04ee54fc899d616cfd82 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,12 +2,22 @@ variables: GITLAB_TOKEN: '${CI_JOB_TOKEN}' NODE_IMAGE_NAME: ${CODE_REGISTRY_IMAGE}/${CI_PROJECT_NAME}:${CI_COMMIT_REF_SLUG}--node +# Do not run for merge requests +workflow: + rules: + - if: $CI_COMMIT_TAG + - if: $CI_COMMIT_BRANCH + stages: - init - node-image - build - publish +default: + tags: + - nshmp + #### # Stage: init #### @@ -50,27 +60,31 @@ Build Node Image: # Stage: Build #### -.node: +Audit: + allow_failure: true + extends: + - .node + needs: [] + script: + - npm audit + +Build Angular: image: ${DEVOPS_REGISTRY}usgs/node:16 needs: - Init - stage: build - tags: - - development - -Build Angular: - extends: - - .node script: - cd example - npm i - npm run build + stage: build Lint Project: - extends: - - .node + image: ${DEVOPS_REGISTRY}usgs/node:16 + needs: + - Init script: - npm run lint + stage: build #### # Stage: Publish @@ -80,6 +94,11 @@ Publish npm: image: ${NODE_IMAGE_NAME} only: - tags + needs: + - Audit + - Init + - Build Angular + - Lint Project script: - git config user.email "${GITLAB_USER_EMAIL}" - git config user.name "${GITLAB_USER_NAME}" @@ -91,5 +110,3 @@ Publish npm: - npx standard-version --release-as ${CI_COMMIT_TAG} --skip.commit --skip.changelog - npm publish --access public stage: publish - tags: - - development