Browse Source

update

main
Zelleg 5 years ago
parent
commit
fbe86edd85
  1. 78
      .circleci/config.yml

78
.circleci/config.yml

@ -4,32 +4,32 @@ jobs:
docker: docker:
- image: cimg/node:14.15.0 # the primary container, where your job's commands are run - image: cimg/node:14.15.0 # the primary container, where your job's commands are run
auth: auth:
username: mydockerhub-user
username: massylz
password: $DOCKERHUB_PASSWORD # context / project UI env-var reference password: $DOCKERHUB_PASSWORD # context / project UI env-var reference
steps: steps:
- checkout # check out the code in the project directory - checkout # check out the code in the project directory
- restore_cache: - restore_cache:
key: npm-v4-dependencies-{{ checksum "yarn.lock" }} key: npm-v4-dependencies-{{ checksum "yarn.lock" }}
- run: yarn install
- save_cache:
- run: yarn install
- save_cache:
key: npm-v4-dependencies-{{ checksum "yarn.lock" }} key: npm-v4-dependencies-{{ checksum "yarn.lock" }}
paths: paths:
- node_modules
- node_modules
test1: test1:
docker: docker:
- image: cimg/node:14.15.0 # the primary container, where your job's commands are run - image: cimg/node:14.15.0 # the primary container, where your job's commands are run
auth: auth:
username: mydockerhub-user
username: massylz
password: $DOCKERHUB_PASSWORD # context / project UI env-var reference password: $DOCKERHUB_PASSWORD # context / project UI env-var reference
steps: steps:
- checkout
- restore_cache:
key: npm-v4-dependencies-{{ checksum "yarn.lock" }}
- run:
name: Lint && format check && test ci
- checkout
- restore_cache:
key: npm-v4-dependencies-{{ checksum "yarn.lock" }}
- run:
name: Lint && format check && test ci
command: | command: |
yarn lint
yarn lint
yarn format:check yarn format:check
yarn test yarn test
@ -37,32 +37,32 @@ jobs:
docker: docker:
- image: cimg/node:14.15.0 # the primary container, where your job's commands are run - image: cimg/node:14.15.0 # the primary container, where your job's commands are run
auth: auth:
username: mydockerhub-user
password: $DOCKERHUB_PASSWORD # context / project UI env-var reference
username: massylz
password: $DOCKERHUB_PASSWORD # context / project UI env-var reference
- image: circleci/postgres:9.6.2-alpine - image: circleci/postgres:9.6.2-alpine
auth: auth:
username: mydockerhub-user
username: massylz
password: $DOCKERHUB_PASSWORD password: $DOCKERHUB_PASSWORD
environment:
environment:
POSTGRES_USER: postgres POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres POSTGRES_PASSWORD: postgres
POSTGRES_DB: psdb
POSTGRES_DB: psdb
steps: steps:
- checkout - checkout
- restore_cache: - restore_cache:
key: npm-v4-dependencies-{{ checksum "yarn.lock" }} key: npm-v4-dependencies-{{ checksum "yarn.lock" }}
- run:
- run:
name: yarn e2e test name: yarn e2e test
environment:
environment:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/psdb DATABASE_URL: postgres://postgres:postgres@localhost:5432/psdb
command: yarn test:e2e command: yarn test:e2e
doc:
doc:
docker: docker:
- image: cimg/node:14.15.0 # the primary container, where your job's commands are run - image: cimg/node:14.15.0 # the primary container, where your job's commands are run
auth: auth:
username: mydockerhub-user
password: $DOCKERHUB_PASSWORD # context / project UI env-var reference
steps:
username: massylz
password: $DOCKERHUB_PASSWORD # context / project UI env-var reference
steps:
- checkout - checkout
- restore_cache: - restore_cache:
key: npm-v4-dependencies-{{ checksum "yarn.lock" }} key: npm-v4-dependencies-{{ checksum "yarn.lock" }}
@ -71,46 +71,46 @@ jobs:
command: yarn doc:build command: yarn doc:build
- store_artifacts: - store_artifacts:
path: docs path: docs
building-docker-image:
building-docker-image:
docker: docker:
- image: cimg/node:14.15.0 # the primary container, where your job's commands are run - image: cimg/node:14.15.0 # the primary container, where your job's commands are run
auth: auth:
username: mydockerhub-user
password: $DOCKERHUB_PASSWORD # context / project UI env-var reference
username: massylz
password: $DOCKERHUB_PASSWORD # context / project UI env-var reference
steps: steps:
- checkout - checkout
- restore_cache: - restore_cache:
key: npm-v4-dependencies-{{ checksum "yarn.lock" }} key: npm-v4-dependencies-{{ checksum "yarn.lock" }}
- setup_remote_docker
- run:
name: build the docker image
- setup_remote_docker
- run:
name: build the docker image
command: | command: |
docker build -t app . docker build -t app .
- run: - run:
name: Try to login
name: Try to login
command: | command: |
echo $DOCKERHUB_PASSWORD | docker login -u mydockerhub-user --password-stdin
echo $DOCKERHUB_PASSWORD | docker login -u massylz --password-stdin
- run: docker push app - run: docker push app
workflows: workflows:
version: 2 version: 2
build_and_test: build_and_test:
jobs:
jobs:
- build - build
- test1: - test1:
requires:
requires:
- build - build
- test2:
requires:
- test2:
requires:
- build - build
- test1
- doc:
requires:
- test1
- doc:
requires:
- build - build
- test1 - test1
- test2 - test2
- building-docker-image: - building-docker-image:
requires:
requires:
- build - build
- test1 - test1
- test2 - test2

Loading…
Cancel
Save