Depending on the situation and use case there are several ways to install
this cookbook. All the methods listed below assume a tagged version release
is the target, but omit the tags to get the head of development. A valid
Chef repository structure like the Opscode repo is also assumed.
To install this cookbook from the Community Site, use the knife command:
knife cookbook site install user
Using Berkshelf
Berkshelf is a cookbook dependency manager and development
workflow assistant. To install Berkshelf:
cd chef-repo
gem install berkshelf
berks init
To use the Community Site version:
echo "cookbook 'user'" >> Berksfile
berks install
Or to reference the Git version:
repo="fnichol/chef-user"
latest_release=$(curl -s https://api.github.com/repos/$repo/git/refs/tags \
| ruby -rjson -e '
j = JSON.parse(STDIN.read);
puts j.map { |t| t["ref"].split("/").last }.sort.last
')
cat >> Berksfile <<END_OF_BERKSFILE
cookbook 'user',
:git => 'git://github.com/$repo.git', :branch => '$latest_release'
END_OF_BERKSFILE
berks install
Using Librarian-Chef
Librarian-Chef is a bundler for your Chef cookbooks.
To install Librarian-Chef:
cd chef-repo
gem install librarian
librarian-chef init
To use the Opscode platform version:
echo "cookbook 'user'" >> Cheffile
librarian-chef install
Or to reference the Git version:
repo="fnichol/chef-user"
latest_release=$(curl -s https://api.github.com/repos/$repo/git/refs/tags \
| ruby -rjson -e '
j = JSON.parse(STDIN.read);
puts j.map { |t| t["ref"].split("/").last }.sort.last
')
cat >> Cheffile <<END_OF_CHEFFILE
cookbook 'user',
:git => 'git://github.com/$repo.git', :ref => '$latest_release'
END_OF_CHEFFILE
librarian-chef install