Skip to content
This repository has been archived by the owner on Jul 14, 2021. It is now read-only.

Upload Cookbooks Specified in Lockfile #119

Merged
merged 11 commits into from
Jul 31, 2014
Merged

Upload Cookbooks Specified in Lockfile #119

merged 11 commits into from
Jul 31, 2014

Conversation

danielsdeleo
Copy link
Contributor

Adds library classes and updates required to upload cookbooks from a policyfile lock. This enables full end-to-end use of Policyfile-based config deployment, including policyfile compilation, cookbook install from upstreams, publish to Chef Server, and chef-client run. As with previous Policyfile features, the upload feature isn't exposed in the CLI yet, so you have to write a small script to drive the library code. An example of this can be found here: https://github.com/danielsdeleo/policyfile-jenkins-demo

There are some open issues I plan to address in future pull requests:

  • The code for reading the Policyfile.lock.json needs to be more defensive, since users will probably modify them by hand even though that's a terrible idea.
  • Cookbooks may have been modified since the Policyfile.lock.json was computed. In some cases (particularly local development), we expect this to happen as part of an "edit, run chef or tests, repeat" development cycle, so that use case needs to work well.

This pull request depends on some changes in chef-client which can be reviewed here: chef/chef#1716 That pull request includes some incompatible changes to internal-ish APIs, so I think we should play it safe and merge only for 12.0. This implies that we're moving ChefDK's internal chef-client dep to 12.0, which should be fine, but we cannot load tools like chefspec into the same ruby VM instance until those tools update.

/cc @opscode/client-engineers

@@ -19,10 +19,11 @@ source 'https://rubygems.org'

gemspec :name => "chef-dk"

gem "chef", ">= 11.14.0.rc.2"
gem "chef", github: "opscode/chef", branch: "policyfile-fixes"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be removed when we merge the upstream PR.

@sersut
Copy link

sersut commented Jul 30, 2014

👍 Nice @danielsdeleo

name = run_list_item.name
name = "#{name}::default" unless name.include?("::")
"recipe[#{name}]"
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'll probably try to move this into core-chef to fix node['recipes'] in chef-12.

@lamont-granquist
Copy link
Contributor

👍

@danielsdeleo danielsdeleo merged commit 0ada21a into master Jul 31, 2014
@danielsdeleo danielsdeleo deleted the lockfile-upload branch July 31, 2014 00:34
ksubrama pushed a commit that referenced this pull request Jan 11, 2016
Patch libyaml on windows manually with version 0.1.5.
@chef-boneyard chef-boneyard locked and limited conversation to collaborators Feb 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants