Streamlining Team Notifications with CircleCI: A Guide to Effective Communication

Streamlining Team Notifications with CircleCI: A Guide to Effective Communication

Introduction :-

Efficient communication within a development team is paramount to successful project management. In the world of #continuous integration and delivery (CI/CD), keeping everyone informed about build statuses, test results, and deployments is crucial. #CircleCI, a popular #CI/CD platform, offers robust notification capabilities to ensure your team stays in the loop. In this guide, we’ll explore how to set up team notifications in CircleCI, enhancing collaboration, transparency, and efficiency within your development processes.

Pre-requestites :-

  • #Circleci application with github repository configured.

  • #Microsoft Teams with channel created.

  • Create context with name “teams” in the Circleci application.

  • #Github Repository with #Circleci full access.

Step-by-step process for configuring teams notification :-

Step-1 :- First, Open your microsoft teams channel and configure a webhook in the same channel.

Step-2 :- Once the webhook configuration is done, copy the webhook url and create an environment variable with name “TEAMS_WEBHOOK_URL” in circleci context & then paste the copied url in the context as shown below.

Step-3 :- After adding the url to the contexts. Open Your config file using Visual studio code and add the below teams orb and step (ms-teams-orb/report:) to configure circleci job notification in teams as shown below.

version: 2.1
orbs:
  ms-teams-orb: opub/ms-teams-orb@1.0.3
  aws-ecr: circleci/aws-ecr@8.2.1

jobs: 
  build:
    docker:
      - image: cimg/python:3.7.9
    working_directory: /tmp/workspace
    environment:
      ENV_FILE: /tmp/workspace/.circleenv
      DOCKER_BUILDKIT: "1"
      BUILDKIT_PROGRESS: plain    
    steps:
       - checkout 
       - setup_remote_docker:
          version: 20.10.14
          docker_layer_caching: true
       - attach_workspace:
          at: /tmp/workspace         

       - run: command
       - ms-teams-orb/report:
          only_on_fail: false
          webhook_url: $TEAMS_WEBHOOK_URL

  push:
    docker:
      - image: cimg/python:3.7.9
    working_directory: /tmp/workspace
    environment:
      ENV_FILE: /tmp/workspace/.circleenv
      DOCKER_BUILDKIT: "1"
      BUILDKIT_PROGRESS: plain    
    steps:
      - checkout
      - setup_remote_docker:
          version: 20.10.14
          docker_layer_caching: true 
      - attach_workspace:
          at: /tmp/workspace                         
      - run:
             name: Login to ECR
             command: |
                sudo apt-get update
                sudo apt-get install -y awscli
                eval $(aws ecr get-login --no-include-email --region ca-central-1)
      - run:
             name: Push Docker image to ECR
             command: 
               docker push 123456789.dkr.ecr.ca-central-1.amazonaws.com/python:3.7

workflows:
  version: 2
  master:
   jobs: 
     - build:
         context: teams
     - push:
        context: teams
        requires:
             - build

Step-4 :- Once the Step and Orb is being added, Commit and push your changes to trigger the #CircleCI pipeline.

Step-5 :- After the commit is done, go head and check whether the circleci job gets triggered and running on your circleci as shown below.

Step-6 :- After the Job successfully completes, Open your Teams Channel and check whether you are able to get the build notifications as shown like below.

Conclusion :-

Effective team communication is the backbone of any successful software development project. With CircleCI’s notification features, you can streamline your CI/CD workflow, ensure faster issue resolution, and keep everyone informed about the status of your builds and deployments. By following the steps outlined in this guide, you’re one step closer to achieving smoother and more efficient development cycles. Start leveraging #CircleCI’s notification capabilities today and watch your team’s collaboration soar. 🚀📢