Jeff Byrnes & Eric Herot of EverTrue
Brought to you by Jeff Byrnes & Eric Herot of EverTrue
Really, it’s all about the bragging rights.
gem 'berkshelf', '~> 3.1'
gem 'chefspec', '~> 4.0'
gem 'foodcritic', '~> 3.0'
gem 'test-kitchen', '~> 1.2'
gem 'kitchen-vagrant', '~> 0.14'
gem 'kitchen-ec2', github: 'test-kitchen/kitchen-ec2'
require 'spec_helper'
describe 'et_travis_demo::default' do
let(:chef_run) { ChefSpec::Runner.new.converge(described_recipe) }
it 'creates the file /tmp/travis_lives' do
expect(chef_run).to create_file '/tmp/travis_lives
end
end
Test that you got what you wanted
describe 'Travis Test Cookbook' do
describe file('/tmp/travis_lives') do
its(:content) { should match("Some content to watch for.\n") }
end
end
driver:
name: ec2
aws_access_key_id: <%= ENV['AWS_ACCESS_KEY_ID'] %>
aws_secret_access_key: <%= ENV['AWS_SECRET_ACCESS_KEY'] %>
aws_ssh_key_id: <%= ENV['AWS_KEYPAIR_NAME'] %>
ssh_key: <%= ENV['EC2_SSH_KEY_PATH'] %>
driver:
[…]
region: us-east-1
availability_zone: us-east-1b
security_group_ids: ['ci-testing']
interface: public
Chef Zero helps especially if dealing with data bags.
provisioner:
name: chef_zero
platforms:
- name: ubuntu-12.04
driver_config:
image_id: ami-36aa4d5e
tags:
Name: travis-ci-default-ubuntu-1204
Env: public