Skip to content

Instantly share code, notes, and snippets.

@bdangit
Created July 30, 2013 20:02
Show Gist options
  • Save bdangit/6116374 to your computer and use it in GitHub Desktop.
Save bdangit/6116374 to your computer and use it in GitHub Desktop.
This is the Thorfile I use in order to perform cookbook version bumps and then upload them to my Chef Server. Since I am using Berkshelf v2.0.7 and a Mac, I have to ensure that there are no .DS_Store files.
# encoding: utf-8
require 'bundler'
require 'bundler/setup'
require 'thor/foodcritic'
require 'thor/scmversion'
require 'berkshelf/thor'
class Berksolo < Thor
include Thor::Actions
# Note on using berkshelf v2.0.7, a bug prevents uploading to Chef
# Server. Need to delete all .DS_Store files since Ridley doesn't
# respect the chefignore properly for .DS_Store files
# ref: http://lists.opscode.com/sympa/arc/chef/2013-07/msg00154.html
# ref: https://github.com/RiotGames/berkshelf/issues/587
desc "upload", "prepares cookbook and uploads it Chef Server"
def upload
run "find . -name '*.DS_Store' -type f -delete"
thor "version:bump", "auto"
thor "berkshelf:upload"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment