Newer
Older
NODE_IMAGE_NAME: ${CODE_REGISTRY_IMAGE}/${CI_PROJECT_NAME}:${CI_COMMIT_REF_SLUG}--node
image: ${CI_REGISTRY}/devops/images/usgs/node:lts
# Do not run for merge requests
workflow:
rules:
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_BRANCH
####
# Stage: Node Image
####
Build Node Image:
image: ${CI_REGISTRY}/devops/images/usgs/docker:20
--build-arg FROM_IMAGE=${CI_REGISTRY}/devops/images/usgs/node:lts \
--pull \
--tag ${NODE_IMAGE_NAME} \
.
- docker push ${NODE_IMAGE_NAME}
name: ${CI_REGISTRY}/devops/images/usgs/docker:20-dind
tags:
- build
variables:
DOCKER_DRIVER: overlay2
Audit:
allow_failure: true
needs: []
script:
- npm audit
Audit Angular:
allow_failure: true
needs: []
script:
- cd example
- npm audit
stage: build
Lint Angular:
needs:
- Init
script:
- cd example
- npm run lint
stage: build
####
# Stage: Test
####
Angular Unit Tests:
artifacts:
paths:
- example/coverage/example
reports:
junit: example/junit.xml
needs:
- Init
script:
- cd example
- npm run test
stage: test
# - Build Angular
# - Lint Project
- Build Node Image
- git config user.email "${GITLAB_USER_EMAIL}"
- git config user.name "${GITLAB_USER_NAME}"
- |
cat <<-EO_CONFIG > .npmrc
@${CI_PROJECT_ROOT_NAMESPACE}:registry=https://${CI_SERVER_HOST}/api/v4/projects/${CI_PROJECT_ID}/packages/npm/
//${CI_SERVER_HOST}/api/v4/projects/${CI_PROJECT_ID}/packages/npm/:_authToken=${CI_JOB_TOKEN}
EO_CONFIG
- npx standard-version --release-as ${CI_COMMIT_TAG} --skip.commit --skip.changelog