From ee31a1bf67464106e5969660ae148b32c6f50048 Mon Sep 17 00:00:00 2001 From: Henna <62267575+HennaAbbas@users.noreply.github.com> Date: Mon, 3 Nov 2025 09:37:22 -0500 Subject: [PATCH 01/14] Update config.yml --- .circleci/config.yml | 174 +++++++++++++++++++------------------------ 1 file changed, 75 insertions(+), 99 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 48a0973..c93b32d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,114 +1,90 @@ version: 2.1 -# Define executors -executors: - node-executor: - docker: - - image: cimg/node:18.17 - working_directory: ~/project -# Define jobs -jobs: - # Job that always runs - test: - executor: node-executor - steps: - - checkout - - run: - name: Run tests - command: echo "run test" - - run: - name: Run linting - command: echo "run linting" - - # Job that always runs - build: - executor: node-executor - steps: - - checkout - - - run: - name: Run tests - command: echo "run test" - - run: - name: Run linting - command: echo "run linting" - - # Conditional job - only runs on main branch - deploy: - executor: node-executor - steps: - - run: - name: Deploy to production - command: | - echo "Deploying to production..." - # Add your deployment commands here - # e.g., aws s3 sync dist/ s3://my-bucket/ - # e.g., kubectl apply -f k8s/ - echo "Deployment completed!" +orbs: + slack: circleci/slack@4.12.5 - # Another conditional job - only runs on feature branches - integration-test: - executor: node-executor - steps: - - run: - name: Run integration tests - command: | - echo "Running integration tests..." - # Add integration test commands here - - -# Define workflows workflows: - version: 2 - build-test-deploy: + my-workflow: jobs: - # These jobs run on every commit - - test - - build: + - build + - test: requires: - - test - - # Conditional job: Deploy only runs on main branch + - build - deploy: requires: - build - filters: - branches: - only: main - - # Conditional job: Integration tests only run on feature branches - - integration-test: + - test + - slack/on-hold: + context: slack-secrets requires: - build filters: branches: - ignore: + only: - main - - develop - - # Alternative workflow that runs only on tags - release: - jobs: - - test: - filters: - tags: - only: /^v.*/ - branches: - ignore: /.*/ - - build: + - notify-on-fail: + context: slack-secrets requires: - - test - filters: - tags: - only: /^v.*/ - branches: - ignore: /.*/ - - deploy: - requires: - - build - filters: - tags: - only: /^v.*/ - branches: - ignore: /.*/ - + - deploy + when: + condition: + or: + - equal: [ cancelled, << pipeline.status >> ] + - equal: [ failed, << pipeline.status >> ] + +jobs: + build: + docker: + - image: cimg/base:stable + steps: + - checkout + - run: echo "Building..." + - slack/notify: + event: fail + custom: | + { + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "❌ Build *cancelled* or *failed*" + } + } + ] + } + + test: + docker: + - image: cimg/base:stable + steps: + - run: echo "Testing..." + + deploy: + docker: + - image: cimg/base:stable + steps: + - run: echo "Deploying..." + - slack/notify: + event: fail + mentions: '@channel' + template: basic_fail_1 + + notify-on-fail: + docker: + - image: cimg/base:stable + steps: + - slack/notify: + event: always + custom: | + { + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "⚠️ Workflow completed with failures or cancellations" + } + } + ] + } From 06b61c2acb76edf6deaa7da2a28cfbedc802524a Mon Sep 17 00:00:00 2001 From: Henna <62267575+HennaAbbas@users.noreply.github.com> Date: Mon, 3 Nov 2025 09:39:12 -0500 Subject: [PATCH 02/14] Update config.yml --- .circleci/config.yml | 70 +++++++++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 34 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c93b32d..ef95483 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -14,23 +14,22 @@ workflows: requires: - build - test - - slack/on-hold: - context: slack-secrets + - notify-cancelled: requires: - - build - filters: - branches: - only: - - main - - notify-on-fail: - context: slack-secrets + - build: + status: cancelled + - test: + status: cancelled + - deploy: + status: cancelled + - notify-failed: requires: - - deploy - when: - condition: - or: - - equal: [ cancelled, << pipeline.status >> ] - - equal: [ failed, << pipeline.status >> ] + - build: + status: failed + - test: + status: failed + - deploy: + status: failed jobs: build: @@ -39,20 +38,8 @@ jobs: steps: - checkout - run: echo "Building..." - - slack/notify: - event: fail - custom: | - { - "blocks": [ - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "❌ Build *cancelled* or *failed*" - } - } - ] - } + # Uncomment to demo failure: + # - run: exit 1 test: docker: @@ -65,12 +52,27 @@ jobs: - image: cimg/base:stable steps: - run: echo "Deploying..." + + notify-cancelled: + docker: + - image: cimg/base:stable + steps: - slack/notify: - event: fail - mentions: '@channel' - template: basic_fail_1 + event: always + custom: | + { + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "⚠️ *Build Cancelled*\nWorkflow: ${CIRCLE_WORKFLOW_ID}\nBranch: ${CIRCLE_BRANCH}" + } + } + ] + } - notify-on-fail: + notify-failed: docker: - image: cimg/base:stable steps: @@ -83,7 +85,7 @@ jobs: "type": "section", "text": { "type": "mrkdwn", - "text": "⚠️ Workflow completed with failures or cancellations" + "text": "❌ *Build Failed*\nWorkflow: ${CIRCLE_WORKFLOW_ID}\nBranch: ${CIRCLE_BRANCH}" } } ] From 49f9263cdcb028010f29f2b7a59bcfb5574e9e04 Mon Sep 17 00:00:00 2001 From: Henna <62267575+HennaAbbas@users.noreply.github.com> Date: Mon, 3 Nov 2025 09:39:53 -0500 Subject: [PATCH 03/14] Update config.yml --- .circleci/config.yml | 62 +++++++------------------------------------- 1 file changed, 9 insertions(+), 53 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ef95483..9d17e1d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,20 +16,16 @@ workflows: - test - notify-cancelled: requires: - - build: - status: cancelled - - test: - status: cancelled - - deploy: - status: cancelled + - build + - test + - deploy + requires-status: cancelled - notify-failed: requires: - - build: - status: failed - - test: - status: failed - - deploy: - status: failed + - build + - test + - deploy + requires-status: failed jobs: build: @@ -49,44 +45,4 @@ jobs: deploy: docker: - - image: cimg/base:stable - steps: - - run: echo "Deploying..." - - notify-cancelled: - docker: - - image: cimg/base:stable - steps: - - slack/notify: - event: always - custom: | - { - "blocks": [ - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "⚠️ *Build Cancelled*\nWorkflow: ${CIRCLE_WORKFLOW_ID}\nBranch: ${CIRCLE_BRANCH}" - } - } - ] - } - - notify-failed: - docker: - - image: cimg/base:stable - steps: - - slack/notify: - event: always - custom: | - { - "blocks": [ - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "❌ *Build Failed*\nWorkflow: ${CIRCLE_WORKFLOW_ID}\nBranch: ${CIRCLE_BRANCH}" - } - } - ] - } + - image: cimg/ From 1a667e8b16fadadf8ed62a081f64526b27ff047c Mon Sep 17 00:00:00 2001 From: Henna <62267575+HennaAbbas@users.noreply.github.com> Date: Mon, 3 Nov 2025 09:41:37 -0500 Subject: [PATCH 04/14] Update config.yml --- .circleci/config.yml | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9d17e1d..1abebae 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -45,4 +45,44 @@ jobs: deploy: docker: - - image: cimg/ + - image: cimg/base:stable + steps: + - run: echo "Deploying..." + + notify-cancelled: + docker: + - image: cimg/base:stable + steps: + - slack/notify: + event: always + custom: | + { + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "⚠️ *Build Cancelled*\nWorkflow: ${CIRCLE_WORKFLOW_ID}\nBranch: ${CIRCLE_BRANCH}" + } + } + ] + } + + notify-failed: + docker: + - image: cimg/base:stable + steps: + - slack/notify: + event: always + custom: | + { + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "❌ *Build Failed*\nWorkflow: ${CIRCLE_WORKFLOW_ID}\nBranch: ${CIRCLE_BRANCH}" + } + } + ] + } From fd0196c2ccd4a47088defd2bb2b707f869325a08 Mon Sep 17 00:00:00 2001 From: Henna <62267575+HennaAbbas@users.noreply.github.com> Date: Mon, 3 Nov 2025 09:45:25 -0500 Subject: [PATCH 05/14] Update config.yml --- .circleci/config.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1abebae..e574be3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -18,14 +18,15 @@ workflows: requires: - build - test - - deploy - requires-status: cancelled + - deploy: + - canelled - notify-failed: requires: - build - test - - deploy - requires-status: failed + - deploy: + - failed + jobs: build: From a5b448c050e2397c6db1a56be7e81e7dfda2d33b Mon Sep 17 00:00:00 2001 From: Henna <62267575+HennaAbbas@users.noreply.github.com> Date: Mon, 3 Nov 2025 09:47:55 -0500 Subject: [PATCH 06/14] Update config.yml --- .circleci/config.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e574be3..8c4bd30 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,14 +16,10 @@ workflows: - test - notify-cancelled: requires: - - build - - test - deploy: - canelled - notify-failed: requires: - - build - - test - deploy: - failed From 85abc302ae0e93587f00dd8b684145d3fae55931 Mon Sep 17 00:00:00 2001 From: Henna <62267575+HennaAbbas@users.noreply.github.com> Date: Mon, 3 Nov 2025 09:48:27 -0500 Subject: [PATCH 07/14] Update config.yml --- .circleci/config.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8c4bd30..eed0080 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,12 +16,10 @@ workflows: - test - notify-cancelled: requires: - - deploy: - - canelled + - build: canceled - notify-failed: requires: - - deploy: - - failed + - deploy: failed jobs: From b72c228dbeee2553a4e6b0c7f188118233b00eb3 Mon Sep 17 00:00:00 2001 From: Henna <62267575+HennaAbbas@users.noreply.github.com> Date: Mon, 3 Nov 2025 09:49:49 -0500 Subject: [PATCH 08/14] Update config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index eed0080..d9b777c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -42,7 +42,7 @@ jobs: docker: - image: cimg/base:stable steps: - - run: echo "Deploying..." + - run: wqr notify-cancelled: docker: From a438621eaefdeb17067283ad75317893c62e7ad7 Mon Sep 17 00:00:00 2001 From: Henna <62267575+HennaAbbas@users.noreply.github.com> Date: Mon, 3 Nov 2025 11:27:31 -0500 Subject: [PATCH 09/14] Update config.yml --- .circleci/config.yml | 58 +++++++++----------------------------------- 1 file changed, 12 insertions(+), 46 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d9b777c..3a3965d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,72 +12,38 @@ workflows: - build - deploy: requires: - - build - test - - notify-cancelled: - requires: - - build: canceled - - notify-failed: + # This job runs if any upstream job fails + - notify-on-failure: requires: + - build: failed + - test: failed - deploy: failed - jobs: build: docker: - image: cimg/base:stable steps: - - checkout - run: echo "Building..." - # Uncomment to demo failure: + # Uncomment to test failure behavior: # - run: exit 1 - + test: docker: - image: cimg/base:stable steps: - run: echo "Testing..." - + deploy: docker: - image: cimg/base:stable steps: - - run: wqr - - notify-cancelled: - docker: - - image: cimg/base:stable - steps: - - slack/notify: - event: always - custom: | - { - "blocks": [ - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "⚠️ *Build Cancelled*\nWorkflow: ${CIRCLE_WORKFLOW_ID}\nBranch: ${CIRCLE_BRANCH}" - } - } - ] - } - - notify-failed: + - run: echo "Deploying..." + + notify-on-failure: docker: - image: cimg/base:stable steps: - - slack/notify: - event: always - custom: | - { - "blocks": [ - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "❌ *Build Failed*\nWorkflow: ${CIRCLE_WORKFLOW_ID}\nBranch: ${CIRCLE_BRANCH}" - } - } - ] - } + - slack/notify: + template: basic_fail_1fail From 606cf685b1694d0a242abc20cf9b2990616cfdb8 Mon Sep 17 00:00:00 2001 From: Henna <62267575+HennaAbbas@users.noreply.github.com> Date: Mon, 3 Nov 2025 11:28:31 -0500 Subject: [PATCH 10/14] Update config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3a3965d..53da877 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -27,7 +27,7 @@ jobs: steps: - run: echo "Building..." # Uncomment to test failure behavior: - # - run: exit 1 + - run: exit 1 test: docker: From 2052a69bbb965cc6d8b0d303608ca657d7f7e7ed Mon Sep 17 00:00:00 2001 From: Henna <62267575+HennaAbbas@users.noreply.github.com> Date: Mon, 3 Nov 2025 11:29:28 -0500 Subject: [PATCH 11/14] Update config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 53da877..a40b0ec 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -46,4 +46,4 @@ jobs: - image: cimg/base:stable steps: - slack/notify: - template: basic_fail_1fail + template: basic_fail_1 From 82e10cdb14251179dc1a71f34405606ca46b7e27 Mon Sep 17 00:00:00 2001 From: Henna <62267575+HennaAbbas@users.noreply.github.com> Date: Mon, 3 Nov 2025 11:56:55 -0500 Subject: [PATCH 12/14] Update config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a40b0ec..5c537f4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -27,7 +27,7 @@ jobs: steps: - run: echo "Building..." # Uncomment to test failure behavior: - - run: exit 1 + - run: wqr test: docker: From 305ff53daa88d3f5b070282ecd28998e1c7d0469 Mon Sep 17 00:00:00 2001 From: Henna <62267575+HennaAbbas@users.noreply.github.com> Date: Mon, 3 Nov 2025 11:58:56 -0500 Subject: [PATCH 13/14] Update config.yml --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5c537f4..6a62c9c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -46,4 +46,5 @@ jobs: - image: cimg/base:stable steps: - slack/notify: + event: always template: basic_fail_1 From 786bb3e7ee3ae1b2f2a8960f8625f605b5553dea Mon Sep 17 00:00:00 2001 From: Henna <62267575+HennaAbbas@users.noreply.github.com> Date: Mon, 3 Nov 2025 11:59:45 -0500 Subject: [PATCH 14/14] Update config.yml --- .circleci/config.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6a62c9c..e74646a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -17,8 +17,7 @@ workflows: - notify-on-failure: requires: - build: failed - - test: failed - - deploy: failed + jobs: build: