Optimize your pipelines in 2021 with these CI/CD best practices

It’s 2021, and CI/CD is instrumental for engineering teams in improving their development cycles. At CircleCI, we are committed to helping our customers achieve more optimized pipelines to streamline their delivery to production.

If your team values quickening your time to market, then we recommend the following 5 resolutions, that will both enhance your CI/CD practice and shorten your development cycle.

Resolution 1: CI/CD is not a novelty, it’s a requirement for all developer teams

Organizations are increasingly emphasizing the importance of their development cycle with the intention of improving code production quality. In our report, the 2020 State of Software Delivery, we’ve analyzed over 55 million data points from more than 44,000 organizations and 160,000 projects on CircleCI.

We saw that some organizations stood out: they were building at scale more quickly and successfully when compared to the rest of the industry. Through our analysis, we found these top-performing teams all tracked higher on 4 key benchmarks.

In 2021, optimize your pipelines by measuring and improving your team’s CI/CD practice across these benchmarks. Learn more about our recommended delivery benchmarks here.

Resolution 2: Make use of precious developer time

Now that you know how to optimize your pipelines via metric benchmarks, your 2nd resolution for 2021 should be to best use precious developer time.

Reuse config

One great way is by never writing the same config twice by using CircleCI’s orbs. Orbs are reusable packages of YAML config, which automate repeated processes and speed up project setup.

Soon, organizations on our Scale Plan will have a way to privately share configuration across multiple projects, within the constrict of their organization. But until then, learn more about our open-source orbs:

  1. Developer Hub - Scan our public registry for open-source orbs, which are reusable packages of config that automate repeated processes and speed up project setup.
  2. Orb Development Kit - The orb development kit helps to streamline the entire orb authoring process for engineers looking to create their own orbs. Developers may now generate a full-featured orb sample project from the CLI.

Caching strategies

An easy way to optimize project builds and workflows is by implementing specific caching strategies, allowing the reuse of existing data from previous builds and workflows. Caching is one of the most effective ways to make jobs faster, whether deciding between a package management application or manually improving your cache.

Learn more about how to optimize builds and workflows in our docs.

Test-splitting

Finally, developers can speed up their project builds by utilizing test splitting. Auto-test splitting shortens the feedback loop by automatically splitting a suite of tests across multiple instances of the same job - or rather a range of test environments running in parallel.

Learn how to significantly reduce your test time specific to your application’s requirements here.

Resolution 3: Secure your pipelines

Using a CI/CD platform that meets well-renown security standards is just as important as intentionally taking measures to secure your pipelines.This resolution is all about ensuring that you are securing your pipelines via added product security features we provide on the CircleCI platform - environment variables, multiple contexts, and admin controls.

Private environment

Private environment variables enable developers to store secrets safely even for their public projects. Secret masking adds another layer of security since it will obscure your environment variables from projects and contexts in your job’s output.

Multiple-contexts per workflow

To further restrict access, multiple-contexts per workflow allows developers to restrict access to environment variables by enabling them to include values in a particular domain, rather than a given workflow. This provides greater permission granularity when requiring access to a specific context in a workflow, improving your organization’s security.

Flexible admin controls

Flexible admin controls allow you to decide user access across your projects. By standardizing accessibility and usage of your CI platform across the org, you maintain your application’s security. Securing your pipelines is just as important as making sure your workflows are operating quickly.

To learn more about the CircleCI product features that provide you with increased application security, check out our Ultimate guide to CI/CD security and DevSecOps blog.

Resolution 4: Maintain test coverage across your pipelines

Using our platform, developers are able to integrate with some of the best of breed dev tools out there, in the form of partner orbs.

Orbs are reusable packages of config that help speed up project set up. CircleCI’s partners offer multiple categories of orbs, from code analysis to deployment, but we wanted to call out the ones which help maintain test coverage across your pipelines.

Below are the most popular partner orb integrations that our users can’t get enough of. Consider using the following as part of your development cycle:

  1. Codecov Upload your coverage reports to Codecov without dealing with complex configurations. Get coverage results of your application quickly, so that you can breathe easier and commit your code with confidence.
  2. Cypress Record results on the Cypress Dashboard and load balance tests in parallel mode. Run end-to-end browser tests without spending time configuring CircleCI.
  3. Sonarcloud Detect bugs and vulnerabilities in your repository before they become an issue.
  4. Coveralls Posts your test suite’s LCOV coverage data to coveralls.io for analysis, change tracking, and notifications. When running on Pull Request builds, a comment will be added to the PR with details on how coverage will be affected if merged.
  5. Snyk Find, fix, and monitor known vulnerabilities in your app dependencies and Docker images.

Resolution 5: Our favorite orbs to have in your wheelhouse

We thought we’d save the best for last in the form of our editor’s choice of CircleCI orbs. Include these orbs is a great way to enhance your CI/CD practice strategy:

  1. Node Easily install Node.js and its package managers (npm, yarn). Best of all, install your packages with caching enabled by default.
  2. Slack Implement event-based notifications across all your CI/CD pipelines. Utilizing built-in message templates or Slack’s visual Block-Kit builder, create and customize notifications specific to your organization’s needs.
  3. AWS-CLI Install and configure the AWS command-line interface (awscli).
  4. Python Enable common CircleCI tasks for the Python programming language.
  5. Ruby Easily cache and install your Ruby Gems automatically, run parallel Rspec tests, or just install Ruby.

To learn more about improving your CI/CD practices and building great applications, check out the CircleCI Developer Hub.

Note: All orbs are public by default. However, if your organization requires the ability to share configuration privately, we’ll soon be releasing the ability to create private orbs. Private orbs will be available exclusively on our Scale Plan. For more information, see our pricing page.