2022-03-17 10:20:40 -04:00
|
|
|
version: 2.1
|
|
|
|
aliases:
|
|
|
|
- &defaults
|
|
|
|
docker:
|
2022-03-29 13:35:42 -04:00
|
|
|
- image: cimg/node:12.22.11-browsers
|
2022-03-29 13:36:11 -04:00
|
|
|
auth:
|
|
|
|
username: $DOCKERHUB_USERNAME
|
|
|
|
password: $DOCKERHUB_PASSWORD
|
2022-03-17 10:20:40 -04:00
|
|
|
working_directory: ~/repo
|
|
|
|
environment:
|
|
|
|
NODE_ENV: production
|
|
|
|
RELEASE_TIMESTAMP: "$(date +'%Y%m%d%H%M%S')"
|
|
|
|
- &setup
|
|
|
|
name: "setup"
|
|
|
|
command: |
|
|
|
|
npm --production=false ci
|
|
|
|
mkdir ./test/results
|
|
|
|
- &lint
|
|
|
|
name: "run lint tests"
|
|
|
|
command: npm run lint
|
|
|
|
- &unit
|
|
|
|
name: "run unit tests"
|
2022-03-29 17:13:04 -04:00
|
|
|
command: JEST_JUNIT_OUTPUT_NAME=unit-jest-results.xml npm run unit -- --reporters=jest-junit
|
2022-03-17 10:20:40 -04:00
|
|
|
- &build
|
|
|
|
name: "run npm build"
|
|
|
|
command: |
|
|
|
|
NODE_ENV=production npm run build
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build-test:
|
|
|
|
<<: *defaults
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run:
|
|
|
|
<<: *setup
|
|
|
|
- run:
|
|
|
|
<<: *lint
|
|
|
|
- run:
|
|
|
|
<<: *unit
|
|
|
|
- run:
|
|
|
|
<<: *build
|
|
|
|
|
|
|
|
workflows:
|
|
|
|
build-test-no-deploy:
|
|
|
|
jobs:
|
|
|
|
- build-test:
|
2022-03-29 13:36:11 -04:00
|
|
|
context:
|
|
|
|
- dockerhub-credentials
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
ignore:
|
|
|
|
- master
|
|
|
|
- develop
|
|
|
|
- /^hotfix\/.*/
|