Menu

Example Configs

Refer to the following documents and linked .circleci/config.yml files for complete examples of public and open source projects that run on CircleCI 2.0.

Video: Test Your Config File Locally

  1. Add a shell script in your .circleci directory, for example, run-build-locally.sh.
  2. Create a personal API token.
  3. Export the token on the command line export CIRCLE_TOKEN=<token-from-step-above>.
  4. Gather the following information:
    • Commit hash from which to build
    • Username
    • Source for project
    • Project name
    • Branch from which to build
  5. Add those values into your shell script.
#!/usr/bin/env bash
curl --user ${CIRCLE_TOKEN}: \
    --request POST \
    --form revision=<commit hash>\
    --form config=@config.yml \
    --form notify=false \
        https://circleci.com/api/v1.1/project/<source, eg. github>/<user name>/<project name>/tree/<branch name>

Now you can run the shell script and debug your config.yml file without having to push through the repo.

Example CircleCI Files and Public Repos

Example Name Description Link
Sample config.yml Files Four sample config.yml files using parallel Workflows, sequential Workflows, fan-in/fan-out Workflows, and building Linux and iOS in one configuration file. Sample config.yml Files
Example Database Configurations Three example config.yml files using PostgreSQL/Rails, Go/PostgreSQL, and Ruby/MySQL Example Database Configurations
Parallel Parallel job run workflow configuration. parallel-jobs/.circleci/config.yml
Sequential Sequential job run workflow configuration sequential-branch-filter/.circleci/config.yml
Fan-in / Fan-out Workflow configuration with sequenced jobs followed by parallel jobs chained to a final sequenced job. fan-in-fan-out/.circleci/config.yml
Workspace Forwarding Jobs configured to share data with workspaces. workspace-forwarding/.circleci/config.yml
circleci-docs A static website generated by Jekyll for CircleCI documentation. circleci-docs/.circleci/config.yml
circleci frontend Mirror of the code that is running CircleCI’s frontend Clojure app. frontend/.circleci/config.yml
circleci-images Contains the official set of container images that CircleCI maintains. circleci-images/.circleci/config.yml
circleci image-builder Uses Docker for building container images. image-builder/.circleci/config.yml
circleci-demo-docker This is an example application showcasing how to build Docker images in CircleCI 2.0. .circleci/config.yml

Open Source Projects by Feature

The following projects provide examples of using features and functionality of CircleCI configuration syntax:

Example Description Project config.yml link
Caching with templates, using workspaces, parallel workflow jobs Build mobile apps with React. react-native/.circleci/config.yml
Build and test with custom container image for ARM and x64 with xvfb and mocha The Electron framework lets you write cross-platform desktop applications using JavaScript, HTML and CSS. It is based on Node.js and Chromium. electron/.circleci/config.yml
Build, test, and upload run for macOS and Linux Conda is a platform- and language-independent package manager that sports easy distribution, installation and version management of software. bioconda-recipes/.circleci/config.yml
Build and register a Docker image, deploy to AWS ECS Taco is a next generation repository system for DLSS. taco/.circleci/config.yml
Docker compose and docker cp with store_artifacts Mayflower is the enterprise design system for the Commonwealth of Massachusetts. mayflower/.circleci/config.yml
Remote Docker, Docker Layer Caching, build and push Docker images Epoch is a new blockchain for æpps. epoch/.circleci/config.yml
Multi-platform build, test, deploy run with fan-out/fan-in workflow Canary is universal serverless single-command deployment. canary/.circleci/config.yml
Build and test on multiple platforms with tagged releases Crystal is a programming language. crystal/.circleci/config.yml
Tagged and scheduled workflow jobs Node.js idiomatic client for Cloud Pub/Sub. nodejs-pubsub/.circleci/config.yml

Open Source Projects by Language

The following projects provide examples for particular programming languages, testing mechanisms, and deployment targets:

Example Description Project config.yml link
Bazel build and testing with xvfb Angular is a development platform for building mobile and desktop web applications using Typescript/JavaScript and other languages. angular/.circleci/config.yml
C++ address sanitizing and thread sanitizing, combined with platform-specific jobs Envoy is an open source edge and service proxy, designed for cloud-native applications. envoy/.circleci/config.yml
Saleseforce DX This repository shows one way you can successfully set up Salesforce DX with CircleCI. sfdx-circleci/.circleci/config.yml
Golang Docker and VM dependencies/lint/build/test with Kubernetes and codecov Istio in an open platform to connect, manage, and secure microservices. istio/.circleci/config.yml
Golang build with junit and Kubernetes tests for prod and master job workflow The Azure Container Service Engine (acs-engine) generates ARM (Azure Resource Manager) templates for Docker enabled clusters on Microsoft Azure with your choice of DC/OS, Kubernetes, Swarm Mode, or Swarm orchestrators. acs-engine/.circleci/config.yml
Go and Node build, package, and deploy run Ignition is a landing page for developers to self-service their way onto your Pivotal Cloud Foundry (PCF) deployment(s). ignition/.circleci/config.yml
Java build and publish with sbt Scio is a Scala API for Apache Beam and Google Cloud Dataflow inspired by Apache Spark and Scalding. scio/.circleci/config.yml
Javascript Node frontend build with junit and end-to-end Webdriver screeshot tests This is the frontend code for cBioPortal using React, MobX and TypeScript. cbioportal-frontend/.circleci/config.yml
Node and Yarn with manual deploy gate Docusaurus is a project for easily building, deploying, and maintaining open source project websites. Docusaurus/.circleci/config.yml
Node and Yarn test and deploy website with caching NEO•ONE makes coding, testing and deploying your NEO blockchain solutions easier. neo-one/.circleci/config.yml
Build and test with NPM and Yarn, deploy to S3 The official CLARK Platform client clark-client/.circleci/config.yml
Python build with Postgres database, Selenium tests, and CodeClimate CALC (formerly known as “Hourglass”), which stands for Contracts Awarded Labor Category, is a tool to help contracting personnel estimate their per-hour labor costs for a contract, based on historical pricing information. calc/.circleci/config.yml
Python build with apt for parallel job run with webhooks notification SunPy is an open-source Python library for solar physics data analysis. sunpy/.circleci/config.yml
Scala and sbt build, test, and release with three workflows Arweave4s is a lightweight modular HTTP client for the Arweave blockchain. arweave4s/.circleci/config.yml

See Also

Refer to Tutorials and Sample Apps for configuration walkthroughs with commented examples and detailed explanations for basic applications written in 11 different languages.