Browse Source

feat: config.yml

main
shootylife 6 years ago
parent
commit
7505a1797f
  1. 85
      .circleci/config.yml
  2. 11
      Dockerfile

85
.circleci/config.yml

@ -0,0 +1,85 @@
version: 2.1
workflows:
version: 2
devopsTP1:
jobs:
- build
- lint:
requires:
- build
- test:
requires:
- build
- bddPostgres:
requires:
- build
- docs:
requires:
- build
- test
- lint
- bddPostgres
jobs:
build:
docker: &config
- image: cimg/node:12.18.4
auth:
username: mydockerhub-user
password: $DOCKERHUB_PASSWORD
steps:
- checkout
- restore_cache:
keys:
- npm-v6-dependencies-{{ checksum "yarn.lock" }}
- run: yarn global add node-gyp && yarn install
- save_cache:
key: npm-v6-dependencies-{{ checksum "yarn.lock" }}
paths:
- ./node_modules
lint:
docker: *config
steps:
- checkout
- restore_cache:
keys:
- npm-v6-dependencies-{{ checksum "yarn.lock" }}
- run: yarn lint && yarn format:check
test:
docker: *config
steps:
- checkout
- restore_cache:
keys:
- npm-v6-dependencies-{{ checksum "yarn.lock" }}
- run: yarn test:ci
bddPostgres:
docker:
- image: cimg/node:12.18.4
environment:
DATABASE_URL: postgres://pasqualini_lucas:pswdevopstpci@localhost:5432/devopstpci
JWT_SECRET: some string
API_HOST: localhost
API_PROTOCOL: http
API_PORT: 3000
- image: circleci/postgres:9.6.2-alpine
environment:
POSTGRES_USER: pasqualini_lucas
POSTGRES_DB: devopstpci
POSTGRES_PASSWORD: pswdevopstpci
steps:
- checkout
- restore_cache:
keys:
- npm-v6-dependencies-{{ checksum "yarn.lock" }}
- run: yarn test:e2e
docs:
docker: *config
steps:
- checkout
- restore_cache:
keys:
- npm-v6-dependencies-{{ checksum "yarn.lock" }}
- run: yarn doc:build
- store_artifacts:
path: doc-server
destination: doc-server

11
Dockerfile

@ -0,0 +1,11 @@
FROM node:12.18.4
COPY /src .
COPY package.json .
COPY yarn.lock .
RUN yarn global add node-gyp && yarn install
RUN yarn start
Loading…
Cancel
Save