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

Add build-cookbook subcommand to chef generate and --delivery option to chef generate cookbook #891

Merged
merged 3 commits into from
Jun 9, 2016

Conversation

danielsdeleo
Copy link
Contributor

  • Add new option -d/--delivery to chef generate cookbook, which will create a .delivery/config.json and build cookbook in the generated cookbook.
  • Add new generator subcommand, chef generate build-cookbook, which creates the .delivery content as above, but outside the context of generating a new cookbook. This includes the same auto-detection logic as pcb to determine if the project is a cookbook or not, and modify the generated content accordingly. Therefore, it can potentially replace the pcb cookbook's role in delivery init.

For both use cases, I compared the generated files to those created by delivery init -l, and confirmed there are no substantive differences.

# `.delivery/.delivery/build-cookbook`.
#
# Note that we don't check the name of the build cookbook the user
# asked for and we hard-code to naming it "build-cookbook". We also
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the name hard coding to keep it in line with existing behavior?

Copy link
Contributor

Choose a reason for hiding this comment

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

I ask because we can specify the cookbook name in the .delivery/config.json so it doesn't need to be hardcoded. Not a huge deal either way

Copy link
Contributor Author

Choose a reason for hiding this comment

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

delivery init doesn't give you a choice in the matter, you always get build-cookbook. Even if you ask it not to make a build cookbook, the Delivery config.json it creates is still hard coded to a local build cookbook named build-cookbook. Given all that, it seems like demand for differently-named build cookbooks is low to nonexistent so I decided it's probably not worth the trouble to implement, but figured it's worth a note in the code to explain that I took a shortcut.

@danielsdeleo danielsdeleo force-pushed the generate-delivery-config branch from 4939162 to 0e109e3 Compare June 9, 2016 20:30
@danielsdeleo danielsdeleo merged commit 0e109e3 into master Jun 9, 2016
@danielsdeleo danielsdeleo deleted the generate-delivery-config branch June 9, 2016 20:44
@mwrock mwrock changed the title Generate delivery config Add build-cookbook subcommand to chef generate and --delivery option to chef generate cookbook Jun 10, 2016
@thommay thommay added Type: Enhancement Adds new functionality. and removed Enhancement labels Feb 1, 2017
@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
Type: Enhancement Adds new functionality.
Development

Successfully merging this pull request may close these issues.

5 participants