From 7505a1797fd7528c3bdc3aaaa245be5f3cb51ba2 Mon Sep 17 00:00:00 2001 From: shootylife Date: Mon, 2 Nov 2020 11:21:09 +0100 Subject: [PATCH] feat: config.yml --- .circleci/config.yml | 85 ++++++++++++++++++++++++++++++++++++++++++++ Dockerfile | 11 ++++++ 2 files changed, 96 insertions(+) create mode 100644 .circleci/config.yml create mode 100644 Dockerfile diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..15fa900 --- /dev/null +++ b/.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 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c8667d6 --- /dev/null +++ b/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