From bd13624de1bb1944e8cd53e3d3cd67dcfde7f5b8 Mon Sep 17 00:00:00 2001 From: Louis Dutoit Date: Mon, 2 Nov 2020 09:21:33 +0100 Subject: [PATCH 02/23] yarn global add node-gyp && yarn install --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3d3830b..34576ae 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,4 +8,4 @@ jobs: password: $DOCKERHUB_PASSWORD # context / project UI env-var reference steps: - checkout # check out the code in the project directory - - run: echo "hello world" # run the `echo` command \ No newline at end of file + - run: yarn global add node-gyp && yarn install \ No newline at end of file From f9028f35b42cf456a514abd2398dd5bde14ba247 Mon Sep 17 00:00:00 2001 From: Louis Dutoit Date: Mon, 2 Nov 2020 09:44:25 +0100 Subject: [PATCH 03/23] caching system --- .circleci/config.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 34576ae..27ebfbd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,4 +8,8 @@ jobs: password: $DOCKERHUB_PASSWORD # context / project UI env-var reference steps: - checkout # check out the code in the project directory - - run: yarn global add node-gyp && yarn install \ No newline at end of file + - run: yarn global add node-gyp && yarn install + - restore_cache : + keys : + - npm-v1-dependencies-{{ checksum "yarn.lock" }} + \ No newline at end of file From 6a862882b71f1d055939cbc15993d651f67e24e0 Mon Sep 17 00:00:00 2001 From: Louis Dutoit Date: Mon, 2 Nov 2020 09:58:58 +0100 Subject: [PATCH 04/23] lint --- .circleci/config.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 27ebfbd..cc51a31 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,6 +1,6 @@ version: 2.1 jobs: - build: + install: docker: - image: cimg/node:14.10.1 # the primary container, where your job's commands are run auth: @@ -12,4 +12,7 @@ jobs: - restore_cache : keys : - npm-v1-dependencies-{{ checksum "yarn.lock" }} + lint: + steps: + - run: yarn lint && yarn format:check \ No newline at end of file From 839961551021338c8052c6932a4e02536ea4cc69 Mon Sep 17 00:00:00 2001 From: Louis Dutoit Date: Mon, 2 Nov 2020 10:18:04 +0100 Subject: [PATCH 05/23] lint --- .circleci/config.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index cc51a31..a47e43d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,7 @@ version: 2.1 jobs: - install: - docker: + install: &shared_docker + docker: - image: cimg/node:14.10.1 # the primary container, where your job's commands are run auth: username: mydockerhub-user @@ -13,6 +13,6 @@ jobs: keys : - npm-v1-dependencies-{{ checksum "yarn.lock" }} lint: - steps: - - run: yarn lint && yarn format:check - \ No newline at end of file + <<: *shared_docker + steps: + - run: yarn lint && yarn format:check \ No newline at end of file From e192b8c78eec5527351bc2be7d7e08045932af35 Mon Sep 17 00:00:00 2001 From: Louis Dutoit Date: Mon, 2 Nov 2020 10:19:06 +0100 Subject: [PATCH 06/23] lint --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a47e43d..6096c22 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,6 +1,6 @@ version: 2.1 jobs: - install: &shared_docker + build: &shared_docker docker: - image: cimg/node:14.10.1 # the primary container, where your job's commands are run auth: From 4670f5762c506323c308632cd79a74ee09c3f679 Mon Sep 17 00:00:00 2001 From: Louis Dutoit Date: Mon, 2 Nov 2020 10:40:34 +0100 Subject: [PATCH 07/23] add workflows --- .circleci/config.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6096c22..002e315 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -15,4 +15,11 @@ jobs: lint: <<: *shared_docker steps: - - run: yarn lint && yarn format:check \ No newline at end of file + - run: yarn lint && yarn format:check + +workflows: + version: 2 + build_test: + jobs : + - build + - lint From ac1d6e0908deb52f18903d295f01f3d94cf4e259 Mon Sep 17 00:00:00 2001 From: Louis Dutoit Date: Mon, 2 Nov 2020 10:53:55 +0100 Subject: [PATCH 08/23] updated workflow --- .circleci/config.yml | 6 ++++++ package.json | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 002e315..88a08d2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,6 +16,11 @@ jobs: <<: *shared_docker steps: - run: yarn lint && yarn format:check + + test: + <<: *shared_docker + steps: + - run: yarn test:ci workflows: version: 2 @@ -23,3 +28,4 @@ workflows: jobs : - build - lint + - test \ No newline at end of file diff --git a/package.json b/package.json index a4f54c1..96ef36c 100644 --- a/package.json +++ b/package.json @@ -20,8 +20,8 @@ "test:cov": "jest --coverage", "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand", "test:e2e": "jest --config ./test/jest-e2e.json", - "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\" \"./**/*.{yaml,yml}\"", - "format:check": "prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"./**/*.{yaml,yml}\"", + "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"", + "format:check": "prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\"", "generate": "hygen" }, "dependencies": { From 22d93306e9ab0d436cdef7cb4cbc60e3e204a7c3 Mon Sep 17 00:00:00 2001 From: Louis Dutoit Date: Mon, 2 Nov 2020 11:15:01 +0100 Subject: [PATCH 09/23] fix yarn import --- .circleci/config.yml | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 88a08d2..9f5e904 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,7 @@ version: 2.1 jobs: - build: &shared_docker - docker: + build: + docker: &shared_docker - image: cimg/node:14.10.1 # the primary container, where your job's commands are run auth: username: mydockerhub-user @@ -12,16 +12,29 @@ jobs: - restore_cache : keys : - npm-v1-dependencies-{{ checksum "yarn.lock" }} + lint: - <<: *shared_docker + docker: *shared_docker steps: + - checkout # check out the code in the project directory + - run: yarn global add node-gyp && yarn install + - restore_cache : + keys : + - npm-v1-dependencies-{{ checksum "yarn.lock" }} + - run: yarn lint && yarn format:check - + test: - <<: *shared_docker + docker: *shared_docker steps: - - run: yarn test:ci + - checkout # check out the code in the project directory + - run: yarn global add node-gyp && yarn install + - restore_cache : + keys : + - npm-v1-dependencies-{{ checksum "yarn.lock" }} + - run: yarn test:ci + workflows: version: 2 build_test: From a2525a21928a6914cfda7c89b38786ca1052c948 Mon Sep 17 00:00:00 2001 From: Louis Dutoit Date: Mon, 2 Nov 2020 11:30:30 +0100 Subject: [PATCH 10/23] updated config --- .circleci/config.yml | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9f5e904..fcc5af7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,7 @@ version: 2.1 jobs: - build: - docker: &shared_docker + build: &shared_docker + docker: - image: cimg/node:14.10.1 # the primary container, where your job's commands are run auth: username: mydockerhub-user @@ -12,27 +12,13 @@ jobs: - restore_cache : keys : - npm-v1-dependencies-{{ checksum "yarn.lock" }} - lint: - docker: *shared_docker + <<: *shared_docker steps: - - checkout # check out the code in the project directory - - run: yarn global add node-gyp && yarn install - - restore_cache : - keys : - - npm-v1-dependencies-{{ checksum "yarn.lock" }} - - run: yarn lint && yarn format:check - test: - docker: *shared_docker + <<: *shared_docker steps: - - checkout # check out the code in the project directory - - run: yarn global add node-gyp && yarn install - - restore_cache : - keys : - - npm-v1-dependencies-{{ checksum "yarn.lock" }} - - run: yarn test:ci workflows: @@ -40,5 +26,9 @@ workflows: build_test: jobs : - build - - lint - - test \ No newline at end of file + - lint: + requires: + - build + - test: + requires: + - build \ No newline at end of file From 1001243d125295c3ba733fe566b69096bbf0de53 Mon Sep 17 00:00:00 2001 From: Louis Dutoit Date: Mon, 2 Nov 2020 11:30:30 +0100 Subject: [PATCH 11/23] Revert "updated config" This reverts commit a2525a21928a6914cfda7c89b38786ca1052c948. --- .circleci/config.yml | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fcc5af7..9f5e904 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,7 @@ version: 2.1 jobs: - build: &shared_docker - docker: + build: + docker: &shared_docker - image: cimg/node:14.10.1 # the primary container, where your job's commands are run auth: username: mydockerhub-user @@ -12,13 +12,27 @@ jobs: - restore_cache : keys : - npm-v1-dependencies-{{ checksum "yarn.lock" }} + lint: - <<: *shared_docker + docker: *shared_docker steps: + - checkout # check out the code in the project directory + - run: yarn global add node-gyp && yarn install + - restore_cache : + keys : + - npm-v1-dependencies-{{ checksum "yarn.lock" }} + - run: yarn lint && yarn format:check + test: - <<: *shared_docker + docker: *shared_docker steps: + - checkout # check out the code in the project directory + - run: yarn global add node-gyp && yarn install + - restore_cache : + keys : + - npm-v1-dependencies-{{ checksum "yarn.lock" }} + - run: yarn test:ci workflows: @@ -26,9 +40,5 @@ workflows: build_test: jobs : - build - - lint: - requires: - - build - - test: - requires: - - build \ No newline at end of file + - lint + - test \ No newline at end of file From 7db5b0f876e1b68b62f6357027aa2faf334512a7 Mon Sep 17 00:00:00 2001 From: Louis Dutoit Date: Tue, 3 Nov 2020 14:54:47 +0100 Subject: [PATCH 12/23] e2etest --- .circleci/config.yml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9f5e904..d546c8b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -35,10 +35,30 @@ jobs: - run: yarn test:ci + e2etest: + docker: *shared_docker + environment: + POSTGRES_USER: user_e2e + POSTGRES_DB: db + POSTGRES_PASSWORD: password + steps: + - checkout + - restore_cache: + key: yarn-packages-v2{{ checksum "yarn.lock" }} + - run: + command: yarn test:e2e + environment: + DATABASE_URL: postgres://user_e2e:password@localhost:5432/db + API_PORT: 3000 + API_HOST: localhost + API_PROTOCOL: http + JWT_SECRET: secret + workflows: version: 2 build_test: jobs : - build - lint - - test \ No newline at end of file + - test + - e2etest \ No newline at end of file From d3292dd4fc0ae5acf5e83809aff3dc4103269706 Mon Sep 17 00:00:00 2001 From: Louis Dutoit Date: Tue, 3 Nov 2020 15:12:28 +0100 Subject: [PATCH 13/23] fix e2e --- .circleci/config.yml | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d546c8b..a76d1f6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -35,24 +35,26 @@ jobs: - run: yarn test:ci - e2etest: - docker: *shared_docker + bddPostgres: + docker: + - image: cimg/node:12.18.4 environment: - POSTGRES_USER: user_e2e - POSTGRES_DB: db + DATABASE_URL: postgres://psqluser:password@localhost:5432/psdb + JWT_SECRET: some string + API_HOST: localhost + API_PROTOCOL: http + API_PORT: 3000 + - image: circleci/postgres:9.6.2-alpine + environment: + POSTGRES_USER: psqluser + POSTGRES_DB: psdb POSTGRES_PASSWORD: password - steps: - - checkout - - restore_cache: - key: yarn-packages-v2{{ checksum "yarn.lock" }} - - run: - command: yarn test:e2e - environment: - DATABASE_URL: postgres://user_e2e:password@localhost:5432/db - API_PORT: 3000 - API_HOST: localhost - API_PROTOCOL: http - JWT_SECRET: secret + steps: + - checkout + - restore_cache: + keys: + - npm-v6-dependencies-{{ checksum "yarn.lock" }} + - run: yarn test:e2e workflows: version: 2 From 261482af997296f9aec2ec0aa64881e6143ec49a Mon Sep 17 00:00:00 2001 From: Louis Dutoit Date: Tue, 3 Nov 2020 15:15:14 +0100 Subject: [PATCH 14/23] e2e test --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a76d1f6..5573264 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -35,7 +35,7 @@ jobs: - run: yarn test:ci - bddPostgres: + e2etest: docker: - image: cimg/node:12.18.4 environment: From 124205fa9a21345ae250abe948d383aeea790416 Mon Sep 17 00:00:00 2001 From: Louis Dutoit Date: Tue, 3 Nov 2020 15:18:48 +0100 Subject: [PATCH 15/23] e2e test --- .circleci/config.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5573264..16289b0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -51,9 +51,11 @@ jobs: POSTGRES_PASSWORD: password steps: - checkout + - run: yarn global add node-gyp && yarn install - restore_cache: keys: - - npm-v6-dependencies-{{ checksum "yarn.lock" }} + - npm-v1-dependencies-{{ checksum "yarn.lock" }} + - run: yarn test:e2e workflows: From 0da7121fd0e3f9428f9bb4cdbefd8d6eff48606b Mon Sep 17 00:00:00 2001 From: Louis Dutoit Date: Tue, 3 Nov 2020 15:38:28 +0100 Subject: [PATCH 16/23] add cache --- .circleci/config.yml | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 16289b0..f673b74 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,12 +12,15 @@ jobs: - restore_cache : keys : - npm-v1-dependencies-{{ checksum "yarn.lock" }} + - save_cache: + paths: + - ./node_modules + key: npm-v1-dependencies-{{ checksum "yarn.lock" }} lint: docker: *shared_docker steps: - - checkout # check out the code in the project directory - - run: yarn global add node-gyp && yarn install + - checkout # check out the code in the project director - restore_cache : keys : - npm-v1-dependencies-{{ checksum "yarn.lock" }} @@ -27,8 +30,7 @@ jobs: test: docker: *shared_docker steps: - - checkout # check out the code in the project directory - - run: yarn global add node-gyp && yarn install + - checkout # check out the code in the project director - restore_cache : keys : - npm-v1-dependencies-{{ checksum "yarn.lock" }} @@ -51,7 +53,6 @@ jobs: POSTGRES_PASSWORD: password steps: - checkout - - run: yarn global add node-gyp && yarn install - restore_cache: keys: - npm-v1-dependencies-{{ checksum "yarn.lock" }} @@ -63,6 +64,12 @@ workflows: build_test: jobs : - build - - lint - - test - - e2etest \ No newline at end of file + - lint: + requires: + - build + - test: + requires: + - build + - e2etest: + requires: + - build \ No newline at end of file From e42a12b0ea01e2c529bb991401918e037cc7b9be Mon Sep 17 00:00:00 2001 From: Louis Dutoit Date: Tue, 3 Nov 2020 16:35:20 +0100 Subject: [PATCH 17/23] dockerfile --- Dockerfile | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..46c5385 --- /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 \ No newline at end of file From 133e9c2a05006621bf5a5c603b6b0378073aa51e Mon Sep 17 00:00:00 2001 From: Louis Dutoit Date: Wed, 4 Nov 2020 18:06:16 +0100 Subject: [PATCH 18/23] doc --- .circleci/config.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f673b74..615008b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -59,6 +59,16 @@ jobs: - run: yarn test:e2e + documentation: + docker: *shared_docker + steps: + - checkout # check out the code in the project director + - restore_cache : + keys : + - npm-v1-dependencies-{{ checksum "yarn.lock" }} + + - run: yarn doc:build + workflows: version: 2 build_test: @@ -72,4 +82,7 @@ workflows: - build - e2etest: requires: - - build \ No newline at end of file + - build + - documentation: + requires: + - build \ No newline at end of file From c910a3c2fb27e2c855cc5c27f12a8fc388c0b193 Mon Sep 17 00:00:00 2001 From: Louis Dutoit Date: Wed, 4 Nov 2020 18:16:40 +0100 Subject: [PATCH 19/23] update requires + artifact --- .circleci/config.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 615008b..71909a5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -69,6 +69,10 @@ jobs: - run: yarn doc:build + - store_artifacts: + path: /tmp/artifact + destination: artifact-file + workflows: version: 2 build_test: @@ -85,4 +89,7 @@ workflows: - build - documentation: requires: - - build \ No newline at end of file + - build + - test + - lint + - e2etest \ No newline at end of file From 491f66a5e116b4b864eaf78624007ef331259d6d Mon Sep 17 00:00:00 2001 From: Louis Dutoit Date: Wed, 4 Nov 2020 18:22:38 +0100 Subject: [PATCH 20/23] change path --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 71909a5..419bc45 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -70,7 +70,7 @@ jobs: - run: yarn doc:build - store_artifacts: - path: /tmp/artifact + path: /dock-server destination: artifact-file workflows: From bded20e25c63fe437f36c6419cde3da65c563e29 Mon Sep 17 00:00:00 2001 From: Louis Dutoit Date: Wed, 4 Nov 2020 18:33:23 +0100 Subject: [PATCH 21/23] doc --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 419bc45..0a7c289 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -70,7 +70,7 @@ jobs: - run: yarn doc:build - store_artifacts: - path: /dock-server + path: doc-server destination: artifact-file workflows: From 78eb83493be4e60858e6caa9cf03c3d3cffefdf3 Mon Sep 17 00:00:00 2001 From: Louis Dutoit Date: Wed, 4 Nov 2020 18:35:48 +0100 Subject: [PATCH 22/23] doc --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0a7c289..0403009 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -70,7 +70,7 @@ jobs: - run: yarn doc:build - store_artifacts: - path: doc-server + path: ./doc-server destination: artifact-file workflows: From e67fe72c40b474cdc1102689d05e771600dc60af Mon Sep 17 00:00:00 2001 From: Louis Dutoit Date: Wed, 4 Nov 2020 18:43:36 +0100 Subject: [PATCH 23/23] changed artifact destination --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0403009..0784929 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -70,8 +70,8 @@ jobs: - run: yarn doc:build - store_artifacts: - path: ./doc-server - destination: artifact-file + path: doc-server + destination: doc-server workflows: version: 2