Continuous integration and delivery (CI/CD) optimizes team development flows by automating build, test, and deployment processes to ensure fast and reliable delivery of high-quality software. Adopting best-in-class CI/CD tooling is one of the best investments your organization can make to shorten delivery cycles, eliminate painful manual processes, and keep infrastructure costs in check.
Despite these benefits, bringing new technologies into your toolchain sometimes involves a long and frustrating learning process. Fortunately, CircleCI provides several tools you can use to streamline the onboarding process and get up and running with a fast and secure pipeline in a matter of minutes, regardless of experience level.
In this blog post, we’ll highlight some popular features that make setting up, managing, and sharing your CircleCI pipelines faster and more intuitive. We’ll look at a typical onboarding flow and point out where and how you can use the following tools to get up to speed quickly:
We’ll also explore how features like the CircleCI CLI, Insights dashboard, and private and public orbs can help you optimize your pipelines for easier, safer, more efficient delivery. Let’s get started!
Step 0: Connect a project to CircleCI
The first step to automating your development workflows with CircleCI is to connect your code repository to monitor for changes in your code base. CircleCI supports all major version control systems, including GitHub, GitLab, and Bitbucket. Follow our quickstart guide to connect your repo and set up a project.
If you are a VS Code user, now would also be a great time to install our official VS Code extension, which offers several features to help you set up and manage your pipelines from the comfort of your IDE. You can select which projects, branches, and statuses to follow from the settings pane.
You can install the extension directly in VS Code or download it from the Visual Studio marketplace.
Step 1: Set up a pipeline configuration file
CircleCI uses YAML configuration files stored in a
.circleci directory in your project repo to define the various jobs to be performed in your pipeline. If you don’t already have a config file in your project repo, you can add a sample configuration for your preferred programming language during project setup by selecting the “Fast” option in the project setup dialog, or by copying one of the sample configurations in our docs.
While it is possible to edit your
config.yml file directly in the CircleCI web app, the CircleCI VS Code extension offers a config helper to help you create, modify, and troubleshoot your configuration files through the use of real-time feedback directly in your development environment.
Some of the config management features in the extension include:
- Syntax validation
- Syntax highlighting
- Go-to-definition and go-to-reference
- On-hover documentation and usage hints
Having these features available in your IDE can shorten your config learning curve and make it easier to tailor your pipelines to your team’s unique needs.
You can learn more about the config SDK in Introducing the CircleCI Config SDK. For more information on all the possible ways to orchestrate workflows in your config files, visit the configuration introduction and configuration reference in our docs.
Step 2: Validate your config and run a workflow
Now that you have configured your pipeline, you can validate your config file locally before triggering a workflow run on CircleCI. This can save you time and money by catching errors and preventing misconfigured workflows from running in the cloud.
There are two ways to validate your CircleCI config before triggering your pipelines:
- From the command line with the CircleCI CLI
- Through a command in the VS Code extension
The CircleCI CLI is a useful tool for interacting with your config files and pipelines from your local environment. To use it for validating and troubleshooting your config, first install the CLI, then use the command
circleci config validate. The CLI will display in the terminal details about any errors in the config file.
The same command is also available through the VS Code extension. You can enter cmd+shift+P to open the commands palette, then choose the command “CircleCI: Validate Configuration”.
Any errors identified are displayed in VS Code output panel.
Once you have confirmed your config file is free from errors, you can trigger a pipeline by committing a change to your application code in your project repository. You can monitor your workflow status in the VS Code extension using the pipelines manager.
From the pipelines panel, you can quickly identify successful or failed workflows, cancel running jobs, rerun failed or canceled workflows from the beginning, provide approvals for jobs with manual review requirements, download build artifacts, and more.
Step 3: Expand and optimize your config
Now that you have a working pipeline, you can look for ways to get more out of your workflows in terms of both scope and efficiency. Some options for expanding the scope of work performed in your pipeline include:
- Adding tests for better security and code quality
- Storing build artifacts to make job data available in the future
- Adding a deployment job to automatically deploy your application to a hosting platform
The good news is that you do not need to implement these types of jobs from scratch. CircleCI offers a number of orbs, or reusable packages of configuration code, built specifically to make integrating third-party tools into your workflows easier and safer. Learn more about using orbs on our blog.
As your pipeline grows in complexity, you may also find opportunities to make it run faster using one of the following optimizations:
One of the best ways to find optimization opportunities is to consult the Insights dashboard in the CircleCI web app. From this panel, you can view historical data about workflow duration, throughput, success rates, and recovery times, as well as the credits consumed on each workflow run.
Taking the time to learn more about optimization techniques and how to use the Insights dashboard to evaluate your pipeline performance can pay huge dividends in terms of both time and money spent on your CI/CD pipeline.
The VS Code extension makes it easy to spot unoptimized configuration, by providing warnings about unused jobs, deprecated keys or images, and by flagging new available versions of orbs or images. It also provides some usage hints based on patterns we’ve identified among new users.
Step 4 (Advanced): Share and secure your config
Once you have a sophisticated, fast-running pipeline in place, it’s time to share your work with other teams and projects so that they can achieve the same levels of performance. CircleCI’s orbs and config SDK allow you to package up and share configuration across teams for easy reuse of important tools and processes.
With orbs, you can abstract key portions of your config so that they can be imported into other projects across your organization. Orbs can be either public or private. Private orbs are particularly useful for sharing internal tooling and frameworks with your team. You can learn more about orb authoring in our docs or follow our tutorial for creating private orbs for your organization.
Finally, as the use of CI/CD expands throughout your organization, you may want to implement some rules to ensure the consistency and security of your pipelines. Config policies is a feature available on our scale plan that lets you enforce global requirements and restrictions on the workloads and tools used in your organization’s pipelines. Any pipelines that violate the policy will automatically fail.
Config policies are particularly useful for platform teams managing CI/CD pipelines at scale. You can use it in combination with the other features in this guide to help new users not only get up to speed quickly but also follow organizational best practices as they do.
Modern CI/CD technologies are incredibly versatile but can sometimes feel overwhelming for new users. If you’re just getting started with CircleCI, or if you’re bringing new team members onto the platform, take advantage of our user-friendly tools to help unlock all the benefits of an automated development flow.
Beyond this selection of tools, CircleCI offers a wide range of custom support and on-demand learning resources to assist you on your path towards DevOps maturity:
- Free learning modules on a range of topics at CircleCI Academy
- An active, welcoming Discuss community
- One-on-one configuration reviews and ticket resolution with our premium support plans
- In-depth technical documentation for every CircleCI feature
- Developer-friendly tutorials and explainers on our blog
At CircleCI, we believe software should be an idea problem, not a delivery problem. We’re thrilled to have you as part of our community, and we can’t wait to see what you build next. Be sure to reach out to us on Twitter or LinkedIn to let us know how you’re using CI/CD to level up your organization’s software delivery practices.