Start Building for Free

Advanced Config

2 months ago2 min read
Server v4.x
Server v3.x
Server v2.x
On This Page

CircleCI supports many advanced configuration options and features, check out the snippets below to get an idea of what is possible, and get tips for optimizing your advanced configurations.

Check your scripts

Use the shellcheck orb to check all scripts in a project. Check the shellcheck page in the orb registry for versioning and further usage examples (remember to replace x.y.z with a valid version):

You can also use shellcheck with version 2 config, without using the orb, as follows:

For more information on using shell scripts in your config, see the Using Shell Scripts guide.

Browser testing

Use Selenium to manage in-browser testing:

For more information on browser testing, see the Browser Testing guide.

Database testing

Use a service container to run database testing:

For more information on configuring databases, see the Configuring Databases guide.

Run Docker commands to build your Docker images

Run Docker commands to build Docker images. Set up a remote Docker environment when your primary executor is Docker:

For more information on building Docker images, see the Building Docker Images guide.

Tips for advanced configuration

Here are a few tips for optimization and maintaining a clear configuration file.

  • Avoid using large inline bash scripts, especially if used across many jobs. Consider moving large bash scripts into your repo to clean up your config and improve readability.
  • Workspaces can be used to copy external scripts between jobs if you don’t want to do a full checkout.
  • Move the quickest jobs up to the start of your workflows. For example, lint or syntax checking should happen before longer-running, more computationally expensive jobs.
  • Using a “setup” job at the start of a workflow can be helpful to do some preflight checks and populate a workspace for all the following jobs.

See also


Help make this document better

This guide, as well as the rest of our docs, are open source and available on GitHub. We welcome your contributions.

Need support?

Our support engineers are available to help with service issues, billing, or account related questions, and can help troubleshoot build configurations. Contact our support engineers by opening a ticket.

You can also visit our support site to find support articles, community forums, and training resources.