Ruby

This examples show to run Ruby unit tests.

Here’s the project DSL.

.cody/project.rb:

github_url("https://github.com/username/repo")
linux_image("aws/codebuild/standard:4.0")
environment_variables(
  JETS_ENV: Cody.env,
)

Here’s the buildspec:

.cody/buildspec.yml

version: 0.2

phases:
  install:
    runtime-versions:
      ruby: latest
    commands:
      - apt-get update -y && apt-get install -y rsync
  build:
    commands:
      # keep sed comment for older versions of ruby
      - # sed -i '/BUNDLED WITH/Q' Gemfile.lock # hack to fix bundler issue: allow different versions of bundler to work.
      - bundle
      - JETS_ENV=test bundle exec rspec

Create CodeBuild Project

To create the CodeBuild project via CloudFormation run:

cody deploy demo

This creates the CodeBuild project as well as the necessary IAM role.

Start Build

To start a build:

cody start demo

You can also start a build with a specific branch. Remember to git push your branch.

cody start demo -b mybranch

Pro tip: Use the <- and -> arrow keys to move back and forward.

Edit this page

See a typo or an error? You can improve this page. This website is available on GitHub, and contributions are encouraged and welcomed. We love pull requests from you!