This checklist is a guide to making the most of your CircleCI trial. Managing DevOps tools can be complex, so we want to help you understand the full potential of CircleCI so that you can make an informed decision.
This phase is all about getting up-and-running with CircleCI. It is likely that you have already done some or all of these steps, but we want to include them to make sure that you have the best possible starting point for your trial.
Head to https://circleci.com/signup. Click on the “Sign Up” button for whichever VCS provider you would like to use with CircleCI. Sign in with you VCS login and authorize CircleCI to access your repositories.
If an account was created to set up your CircleCI trial, and you haven't removed it yet, do so now.
The CircleCI CLI allows you to run CircleCI actions locally, such as validating your config file, running local builds, and operating on Orbs. If you're using Homebrew on MacOS, run the following command:
$ brew install circleci
Visit this documentation for instructions on other installation methods and on using the CircleCI CLI.
If you have yet to run a build on CircleCI, the introduction walkthrough is one of the best ways to get acquainted with our system and to get your first green build. To get started, head over to the Introduction documentation and follow the instructions.
Once you've gotten your first green build, continue to go through the "Getting Started" section of the CircleCI documentation. This information will give you a good starting point for adapting CircleCI to meet the unique needs of your projects.
Now that you understand the basics of CircleCI, it's time to start customizing your configuration to build the optimal CI framework for your project. In this section we will give you short overviews of the features you can use and provide links to the documentation that will help you incorporate them into your config.yml
file.
You've probably added a new project to CircleCI by now, but here is a quick refresher as you start to experiment with CircleCI on your projects.
📄 Full Projects and Builds documentation
- On the left navigation bar, click “Add Projects”. The list automatically populates with the repositories in your VCS organization. You can search for projects using the “Filter projects…” search bar. If you are setting up a macOS project, click on the “macOS” tab.
- If you aren’t seeing the correct repositories, make sure you are operating in the correct organization. You can switch between your organizations using the drop down in the top left corner.
- Click “Set Up Project” next to the project you want to add to CircleCI.
- On the next screen select the operating system and language for the project. And then copy the sample configuration code.
- In a new browser tab, log in to your VCS, and navigate to the repository that you are setting up.
- In the root directory of the repository, create a new directory named
.circleci
- Inside the
.circleci
folder, create a new file namedconfig.yml
- Paste the sample configuration code into the
config.yml
file and commit it to your master branch - Return to CircleCI and click “Start Building”
- You should be taken to your first build, and you can see the logs from the execution environment
The configuration section of our documentation will walk you through some of CircleCI's more advanced features that will help you begin to build out an advanced CI framework. Here's where you should start:
-
Getting started with CircleCI config
An overview of how CircleCI config and execution works. Introduction to commands, workflow orchestration, and executors.
-
This is the source of truth for CircleCI config. If you're having a tough time writing configuration for a specific feature, this is a good place to start troubleshooting.
-
If you're looking for some inspiration, these example
config.yml
files could help you out.
These are just a few docs to help you get started. We suggest you review the rest of our documentation to gain the best possible understanding of how CircleCI can adapt to your specific use case.
Once you've read through our documentation, spend some time updating your configuration to optimize it for your project. Here are a few questions to ask yourself when doing so:
- Does your workflow optimize for maximum parallelism? The more jobs you can run asynchronously, the quicker your workflow will finish. Here is an example config with parallel jobs.
- Are you running any jobs that are building very slowly? You can declare a more powerful
resource_class
such asmedium+
orlarge
for these jobs to make them run faster. Larger resource classes have more vCPUs and RAM. You can also declare aresource_class: small
for lightweight jobs like code health checks to save credits. There is no secret sauce here for choosing the right resource class, but experimenting can help you optimize your workflows over time. - Do you have commands, jobs, or executors that are repeated in your config? For any of these, you should create reusable components using top level keys:
commands:
reusable-command-1:
# Create a reusable command here. A reusable command can be called as a step in a job.
jobs:
reusable-job-1:
# Create a reusable job here. A reusable job can be used in a workflow.
executors:
reusable-executor-1:
# Create a reusable executor here. Reusable executors can be called as the executor for any job.
- Could any of your commands, jobs, or executors be reused in other projects? If so, you may want to create an orb that defines them.
If one of your jobs fails, one of the best ways to debug it is to SSH into its container as it is running. You can do this by rerunning any failed job with SSH.
To rerun a job with SSH, open the job in the CircleCI UI, then, in the upper right corner of the page, click the arrow next to the "Rerun workflow" button and select "Rerun job with SSH".
From your CLI on your machine, SSH into the build using the information provided in the CircleCI UI. Happy debugging!
One of the best ways to speed up your CircleCI builds is to use good caching practices. You can learn about CircleCI's caching capabilities in our caching documentation. We also have documentation dedicated to techniques for optimizing your caching strategy.
If you're using docker build
in your workflow, you can also use Docker Layer Caching to decrease Docker image build times.
Orbs are reusable, sharable packages of CircleCI configuration. Orbs allow you to import pre-build commands, jobs, and executors into your configuration file, so that you don't spend time reinventing the wheel.
Our ecosystem is already full of existing orbs built by our community. Have a look through the Orbs Registry to see if any existing orbs could simplify your configuration. If want to learn more about using existing orbs, read our documentation.
If you have a use case for an orb that hasn't been created yet, it's easy to build it yourself so that you can use it across all of your projects. Read our documentation on creating orbs to get started.
Note - At this time all orbs are public, meaning that anyone can see their source or use them in a project. Make sure to follow best practices and parameterize any secrets your orb may use so that they are not published in your orb's source code.