0

I'm having issues getting the Git plugin for knife-spork to commit and push to it's repo.

Here's the output from knife spork info:

{"version_change_threshold"=>2,
"preserve_constraint_operators"=>true, 
"always_promote_remote"=>true, 
"skip_berkshelf"=>false, 
"role_match_file_name"=>true, 
"role_safe_delete"=>true, 
"json_options"=>{"indent"=>"  "}, 
"plugins"=>{
  "git"=>{
    "auto_push"=>true, 
    "remote"=>"origin", 
    "branch"=>"master" 
  }
}}

[...]
KnifeSpork::Plugins::Git: enabled
[...]

When I do a knife spork bump COOKBOOK minor:

Git: Pulling latest changes from /path/to/chef-repo/cookbooks/COOKBOOK
Pulling latest changes from git submodules (if any)
Successfully bumped base to v0.2.0!
Git add'ing /path/to/chef-repo/cookbooks/COOKBOOK/metadata.rb

Which only adds it ... Then I do knife spork upload COOKBOOK:

Git: Pulling latest changes from /path/to/chef-repo/cookbooks/COOKBOOK
Pulling latest changes from git submodules (if any)
Freezing COOKBOOK at 0.2.0...
Successfully uploaded COOKBOOK@0.2.0!

Which uploads the cookbook to the chef server, but doesn't commit to the repo or try pushing ... And there's no errors output :/

Just Lucky Really
  • 1,341
  • 1
  • 15
  • 38

1 Answers1

0

Okay Yep I had misunderstood the flow ...

So You have to create your environments first:

knife spork environment create production
knife spork environment create development

Then once the cookbook is ready for an environment, you promote it

knife spork promote development COOKBOOK

And it then commits and pushes it

Just Lucky Really
  • 1,341
  • 1
  • 15
  • 38
  • If you're just starting out with Chef, I would highly recommend looking at the Policy workflow instead of Spork. It's very similar but has some purpose-built workflow tooling. – coderanger Sep 25 '16 at 23:16