From 050ab9222a5b6a4fd0de28db67fefc931f597271 Mon Sep 17 00:00:00 2001 From: Roman Mirr <298544+romiras@users.noreply.github.com> Date: Sun, 28 Nov 2021 23:42:07 +0200 Subject: [PATCH 1/2] Add .circleci/config.yml --- .circleci/config.yml | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 317c069..06207dc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,6 +5,15 @@ version: 2.1 # See: https://circleci.com/docs/2.0/orb-intro/ orbs: node: circleci/node@4.7 + aws-ecr: circleci/aws-ecr@7.3.0 + +############################################################# +# Parameters +############################################################# +parameters: + repo: + type: string + default: "nodejs-playground" jobs: node-test: @@ -34,9 +43,20 @@ jobs: # Invoke jobs via workflows # See: https://circleci.com/docs/2.0/configuration-reference/#workflows workflows: - sample: # This is the name of the workflow, feel free to change it to better match your workflow. - # Inside the workflow, you define the jobs you want to run. + build-and-deploy: jobs: - node-test: context: - playground + - aws-ecr/build-and-push-image: + requires: + - node-test # Only run deploy job once tests passed + repo: << pipeline.parameters.repo >> + filters: + branches: + only: + - master + name: Upgrade & Publish into ECR + context: playground-aws + #Job params + tag: "${CIRCLE_SHA1}" From d20982426b043ad74ff116b078a78d7fe35d6574 Mon Sep 17 00:00:00 2001 From: Roman Mirr <298544+romiras@users.noreply.github.com> Date: Sun, 28 Nov 2021 23:44:49 +0200 Subject: [PATCH 2/2] Updated config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 06207dc..c20b34d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -37,7 +37,7 @@ jobs: done echo Failed waiting for RabbitMQ && exit 1 - - run: npm install + - run: npm ci - run: npm run test # Invoke jobs via workflows