#Setting up your project on CircleCI
Configuring CircleCI with Circle.yml
- Step 1: Follow your GitHub project
- Step 2: There is no step 2!
Gets you:
- Automatic CI builds of all branches
- Automatically infers:
- Language/framework (Ruby/Rails, Python, Node.js, PHP)
- Testing framework (RSpec, Cucumber, and Test::Unit)
- RVM and NPM for dependencies
- Language/framework (Ruby/Rails, Python, Node.js, PHP)
- A large list of available databases & services (see docs)
- Step 1: Follow your GitHub project
- Step 2: Get your Heroku API key and add to CircleCI
- Step 3: Setup an SSH key, add it to Heroku and associate it with your CircleCI account
- Step 4: Create a circle.yml file to the root of your project
deployment:
acceptance:
branch: master
heroku:
appname: myapp-acceptance
staging:
branch: staging
heroku:
appname: myapp-staging
- Step 5: Push
6 sections:
machine
: adjusting the VM to your preferences and requirementscheckout
: checking out and cloning your git repodependencies
: setting up your project's language-specific dependenciesdatabase
: preparing the databases for your teststest
: running your testsdeployment
: deploying your code to your web servers
pre
: List of commands to run before CircleCI's inferred commandspost
: List of commands to run after CircleCI's inferred commandsenvironment
: key/values of env variables globally available for all CI commandstimezone
: timezone you want your CI build to run inhosts
: hostfile entriesruby
: specify ruby version (if not included in your Gemfile)services
: turn on services that are turned off by default
- Inferred command usually sufficient
- Customize with:
pre
/post
oroverride
- Inferred command usually sufficient
- Customize with:
bundler
,pre
/post
oroverride
- Inferred command usually sufficient
- Customize with:
pre
/post
oroverride
- Customize with:
pre
/post
oroverride
- Each key is arbitrary and represents a particular type of deploy
- The key name only matters to you
- The mapping that follows specifies how that deploy is configured
branch
specifies the branch or branches that deploy applies toheroku
specifies the heroku app to deploy tocommands
specifies a list of commands required to execute the deploy