<commit_before>Vagrant boxes
=============
Generate [Vagrant](http://www.vagrantup.com/) boxes with [packer](http://www.packer.io/).

There are three flavors available:
- `debian-7-amd64-plain`: Minimalistic Debian with Virtualbox-additions where applicable.
- `debian-7-amd64-default`: Like above, plus `git`, `rsync`, `ruby` and `puppet`.
- `debian-7-amd64-cm`: Like above, plus [CM framework dependencies](https://github.com/cargomedia/puppet-cm).

Boxes are built and released on [Vagrant Cloud](https://vagrantcloud.com/cargomedia) for `virtualbox` and `aws`.

Usage: Virtualbox
-----------------

Example `Vagrantfile`:
```ruby
Vagrant.configure('2') do |config|
  config.vm.box = 'cargomedia/debian-7-amd64-default'
end
```

Usage: AWS
----------
Based on [official Debian AMIs](https://wiki.debian.org/Cloud/AmazonEC2Image/Wheezy).
Available regions: `eu-west-1`, `us-east-1`.

Example `Vagrantfile` (using the [vagrant AWS provider plugin](https://github.com/mitchellh/vagrant-aws)):
```ruby
Vagrant.configure('2') do |config|
  config.vm.box = 'cargomedia/debian-7-amd64-default'

  config.vm.provider :aws do |aws, override|
    override.ssh.username = 'admin'
    override.ssh.private_key_path = '~/.ssh/<private-key>.pem'

    aws.region = 'eu-west-1'
    aws.instance_type = 'm3.large'
    aws.access_key_id = '<aws-access-key>'
    aws.secret_access_key = '<aws-secret-key>'
    aws.keypair_name = '<keypair-name>'
    aws.security_groups = '<security-group-id>'

    aws.block_device_mapping = [
      {
        'DeviceName' => '/dev/sda',
        'VirtualName' => 'root',
        'Ebs.VolumeSize' => 100,
        'Ebs.DeleteOnTermination' => true,
        'Ebs.VolumeType' => 'io1',
        'Ebs.Iops' => 2000
      }
    ]
  end
end
```

Development (building and uploading)
------------------------------------
Download required puppet modules using [librarian-puppet](http://librarian-puppet.com/):
```
cd puppet
librarian-puppet install
```

Rake parameters:
- builder: A list of builders to use (Default: all builders)
- aws_key_id: AWS key id
- aws_key_secret: AWS key secret
- vagrant_cloud_username: Vagrant Cloud username
- vagrant_cloud_access_token: Vagrant Cloud access token

```
rake build    # Build all boxes
rake spec     # Run serverspec tests (virtualbox build only!)
rake release  # Release boxes to S3 and Vagrant Cloud
```<commit_msg>Use bundler to run commands in readme<commit_after>Vagrant boxes
=============
Generate [Vagrant](http://www.vagrantup.com/) boxes with [packer](http://www.packer.io/).

There are three flavors available:
- `debian-7-amd64-plain`: Minimalistic Debian with Virtualbox-additions where applicable.
- `debian-7-amd64-default`: Like above, plus `git`, `rsync`, `ruby` and `puppet`.
- `debian-7-amd64-cm`: Like above, plus [CM framework dependencies](https://github.com/cargomedia/puppet-cm).

Boxes are built and released on [Vagrant Cloud](https://vagrantcloud.com/cargomedia) for `virtualbox` and `aws`.

Usage: Virtualbox
-----------------

Example `Vagrantfile`:
```ruby
Vagrant.configure('2') do |config|
  config.vm.box = 'cargomedia/debian-7-amd64-default'
end
```

Usage: AWS
----------
Based on [official Debian AMIs](https://wiki.debian.org/Cloud/AmazonEC2Image/Wheezy).
Available regions: `eu-west-1`, `us-east-1`.

Example `Vagrantfile` (using the [vagrant AWS provider plugin](https://github.com/mitchellh/vagrant-aws)):
```ruby
Vagrant.configure('2') do |config|
  config.vm.box = 'cargomedia/debian-7-amd64-default'

  config.vm.provider :aws do |aws, override|
    override.ssh.username = 'admin'
    override.ssh.private_key_path = '~/.ssh/<private-key>.pem'

    aws.region = 'eu-west-1'
    aws.instance_type = 'm3.large'
    aws.access_key_id = '<aws-access-key>'
    aws.secret_access_key = '<aws-secret-key>'
    aws.keypair_name = '<keypair-name>'
    aws.security_groups = '<security-group-id>'

    aws.block_device_mapping = [
      {
        'DeviceName' => '/dev/sda',
        'VirtualName' => 'root',
        'Ebs.VolumeSize' => 100,
        'Ebs.DeleteOnTermination' => true,
        'Ebs.VolumeType' => 'io1',
        'Ebs.Iops' => 2000
      }
    ]
  end
end
```

Development (building and uploading)
------------------------------------
Install dependencies:
```
bundle install
```

Download required puppet modules using [librarian-puppet](http://librarian-puppet.com/):
```
cd puppet/
bundle exec librarian-puppet install
```

Rake parameters:
- builder: A list of builders to use (Default: all builders)
- aws_key_id: AWS key id
- aws_key_secret: AWS key secret
- vagrant_cloud_username: Vagrant Cloud username
- vagrant_cloud_access_token: Vagrant Cloud access token

```
bundle exec rake build    # Build all boxes
bundle exec rake spec     # Run serverspec tests (virtualbox build only!)
bundle exec rake release  # Release boxes to S3 and Vagrant Cloud
```
{'fraction_non_alphanumeric': 0.1710174717368962, 'fraction_numerical': 0.01274409044193217, 'mean_word_length': 3.46831955922865, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 25, 'https://': 8, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4371875', 'n_tokens_mistral': 1729, 'n_tokens_neox': 1619, 'n_words': 386}