Project

thor-tropo

0.0
No commit activity in last 3 years
No release in over 3 years
Thor tasks to package a project
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
~> 1.3
>= 0
>= 0
>= 0
>= 0
>= 0

Runtime

 Project Readme

Thor::Tropo

Tool used to package released for Chef-Solo installs

Installation

Add this line to your application's Gemfile:

gem 'thor-tropo'

And then execute:

$ bundle

Or install it yourself as:

$ gem install thor-tropo

Include in your Thorfile

include "tropo-tropo"

Config

Thor-Tropo expects a .deployer file and will traverse the path from . through ~ until it finds one. The .deployer file format is as follows:

aws_key: xxxx
aws_secret: xxxxx
bucket_name: artifacts.bucket.com
project_name: tropo/12.2.1/cookbooks/functional_deployment

Inside your project you can add the following at the root of your top level cookbook, or as we like to call it, deployment model

~/my_deployment_model/.deploy

project_name: tropo/12.2.1/cookbooks/my_deployment_model
cookbooks:
  - runtime_server
  - gateway_server    

The important thing to know about .deploy files is that they are implemented as a "first win" type of search pattern. So if you run Thor for your current working directory it will traverse the path all the way to your home directoy looking for .deployer files. If it finds one, and it finds a known attribute, it will use that and ignore any higher values.

Example

~/.deployer

bucket_name: foo

~/somewhere/.deployer

bucket_name: bar

If you run thor tropo:package from ~/somewhere/.deployer then the bucket_name value will be bar, becaue that is the first one it found and so it "wins". The intent here was that you can store certain common config values globally by simply keeping a .deployer file in your home dir, and then only apply certain project specific settings inside source control with your deployment model. Hacky? Probably.. But it works well for us :)

Usage

jdyer@retina:~ ยป thor help tropo:package
Usage:
  thor tropo:package

Options:
  -b, [--berkspath=BERKSPATH]                # Berksfile path
  -V, [--version-override=VERSION-OVERRIDE]  # Provide a version for cookbook archive
  -f, [--force]                              # overwrite any files on s3 without confirmation
  -I, [--iam-auth]                           # Use IAM roles for AWS authorization
  -i, [--ignore-dirty]                       # Will ignore any dirty files in git repo and continue to package cookbooks
  -k, [--keeplock]                           # Respect Berksfile.lock
  -c, [--clean-cache]                        # Delete local Berkshelf cookbook cache
  -n, [--no-op]                              # NO-OP mode, Won't actually upload anything.  Useful to see what would have happened

Package cookbooks using Berkshelf and upload file to s3 bucket

Gotcha's

Search Priorities

Then you can run thor-tropo from the model project root once and it will package both cookbooks. However there is some logic here...

  • Use path provided by user via --berkspath flag
  • If there is a Berksfile in the current working directory use that
  • Use .deployer file config for finding cookbooks to package ( Example below of this .deployer config )

~/my_deployment_model/.deploy

project_name: tropo/12.2.1/cookbooks/my_deployment_model
cookbooks:
  - runtime_server
  - gateway_server    

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request