Skip to content

CircleCI

c-Monster edited this page Apr 18, 2017 · 6 revisions

CircleCI Team Access

We use CircleCI for our continuous integration and delivery method. As long as your a member of this GitHub team, you should have access to the Circle builds.

Starting a Build on Circle

  1. Log into Circle
  2. Click "Projects" in the left navigation column
  3. Click "Add Project" in the top-right corner
  4. Select the "byuoitav" organization
  5. Locate the project in question
  6. Click "Build project"

In general, most of our projects should already be building on Circle. In this case, you need to tell your Circle dashboard to follow the project. To do this, follow the steps outlined above and notice that the "Build project" button instead reads "Follow project".

Build Environment

Be sure to use Ubuntu 14.04 in "Build Environment" for projects involving the Go programming language. The other build environments use Go installs that are a few versions behind the latest.

  1. On the left side of your Circle dashboard, hover over the project in question
  2. Click the settings gear icon that appears
  3. In the navigation menu on the left, select "Build Environment" under "Build Settings"
  4. Select "Ubuntu 14.04 (Trusty)"

The page auto-saves changes.

Environment Variables

Our build pipeline relies on environment variables being set in Circle.

Any project that is pushed to Docker Hub needs to have the DOCKER_USERNAME, DOCKER_PASSWORD, and DOCKER_EMAIL environment variables set. Follow the below steps to set environment variables in Circle.

  1. On the left side of your Circle dashboard, hover over the project in question
  2. Click the settings gear icon that appears
  3. In the navigation menu on the left, select "Environment Variables" under "Build Settings"
  4. Click "Add Variable" near the top-right corner
  5. Provide the "Name" and "Value"
  6. Click "Add Variable" in the bottom-right corner of the modal

For security reasons, environment variables in Circle cannot be edited. If you need to change the value of an environment variable, delete the existing variable and create a new one with an identical key name.

Updating Variables in Circle

circleup is a handy tool that deletes an existing variable in a Circle project and creates a new one with an identical key.

Setup:

  1. Clone down the team repository and append the path to the repository to $PATH.
  2. Set another environment variable called CIRCLE_USERNAME (this corresponds with the user that created the Circle project, so it will generally be byuoitav.
  3. Log into Circle and choose "Account Settings" from the navigation menu on the left.
  4. Click "Personal API Tokens", then "Create New Token".
  5. Use the new token to create another environment variable called CIRCLE_API_TOKEN. (The API tokens are unique, so do not add them to the gopass store)

Use:

circleup <PROJECT> <VARIABLE> <NEW VALUE>

For Example

circleup configuration-database-microservice DOCKER_EMAIL monsters

AWS Integration

In order for [[deploy.sh|Deployment-Files#deploysh]] to successfully deploy builds to AWS, we must provide Circle with our AWS CLI credentials.

  1. On the left side of your Circle dashboard, hover over the project in question
  2. Click the settings gear icon that appears
  3. In the navigation menu on the left, select "AWS Permissions" under "Permissions"
  4. Paste in the AWS access key and secret access key into the appropriate fields
  5. Click "Save AWS keys"

If you don't have the team's AWS credentials, ask a teammate.

Slack Integration

For each new project added to Circle, Slack integration must be set up manually.

Tips

On each repository being built by Circle, there is a badge in the README representing the state of the last build in Circle. If a build is marked as "failing", there are a number of possible causes. If this is the case for your repo, check the Circle logs.

Know that a build may succeed but fail to push to the deploy server hosted at AWS. This registers as a "failure".

Clone this wiki locally