From 9a9d64f1913ca118388b939612b8d9d08d11349d Mon Sep 17 00:00:00 2001 From: Morgan <47953421+MorganLmd@users.noreply.github.com> Date: Tue, 3 Nov 2020 17:30:06 +0100 Subject: [PATCH] final step --- .circleci/config.yml | 43 +++++++++++++++++++++++++++++-------------- Dockerfile | 12 ++++++++++++ 2 files changed, 41 insertions(+), 14 deletions(-) create mode 100644 Dockerfile diff --git a/.circleci/config.yml b/.circleci/config.yml index 099f8f9..d43ea45 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,5 +1,6 @@ version: 2.1 +# global cache commands to avoid repetitions commands: restore_cache_cmd: steps: @@ -13,7 +14,7 @@ commands: key: yarn-v3-packages-{{ checksum "yarn.lock" }} jobs: - build1: + build: docker: - image: "circleci/node:12" @@ -25,7 +26,7 @@ jobs: name: "installation" - save_cache_cmd - lint1: + lint: docker: - image: "circleci/node:12" @@ -37,7 +38,7 @@ jobs: name: "lint and format check" - save_cache_cmd - unit1: + unit-tests: docker: - image: "circleci/node:12" @@ -49,7 +50,8 @@ jobs: name: "test unitaires" - save_cache_cmd - database1: + + database: docker: - image: "circleci/node:12" environment: @@ -73,21 +75,34 @@ jobs: name: "test end 2 end db postgres" - save_cache_cmd + documentation: + docker: + - image: "circleci/node:12" + steps: + - checkout + - restore_cache_cmd + - run: + command: yarn doc:build + name: creation de la doc + - store_artifacts: + path: ./doc-server + - save_cache_cmd + workflows: version: 2 test_workflow: jobs: - - build1 - - lint1: + - build + - lint: requires: - - build1 - - unit1: + - build + - unit-tests: requires: - - build1 - - - database1: + - build + - database: + requires: + - build + - documentation requires: - - build1 - - lint1 - - unit1 + - build diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c7fd0b0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +# dockerhub : morganlmd/my-awesome-ci-expr:latest +FROM node:12 + +WORKDIR /usr/src/app + +COPY . . + +RUN yarn global add node-gyp && yarn install + +EXPOSE 3000 + +CMD ["yarn", "start"] \ No newline at end of file