delivery-truck
delivery-truck copied to clipboard
Lay down berkshelf config.json for publish
Fixes #6
Thanks @ndobson for the PR. However this change hard codes a path that is specific to a Delivery Builder (/var/opt/delivery/workspace). Users can (and do) run delivery-truck outside of a Delivery Server (via jenkins) and would not have this file path. Because the Jenkins use case is a first class citizen for delivery-truck we'll need to not hard-code paths like these.
Thanks @tduffield for the feedback! I thought it was acceptable because on line 25 of the publish recipe there is a hard coded config.rb that all knife commands are run with. But if that's not the case is there another approach that you see? I was also thinking something like this (summarizing):
Call Chef_Delivery::ClientHelper.enter_client_mode_as_delivery Reference Chef::Config[:client_key] and Chef::Config[:node_name] for the contents of the file Call Chef_Delivery::ClientHelper.leave_client_mode_as_delivery
Another approach could be to simply wrap the berks config.json file resource in an if block like so:
if File.exists?(File.expand_path(File.join('/var/opt/delivery/workspace/.chef', 'delivery.pem')))
Thoughts?
I think the right answer is to create the file referencing the key and node name like you have above.
Hi. I am an automated pull request bot named Curry. There are commits in this pull request whose authors are not yet authorized to contribute to Chef Software, Inc. projects or are using a non-GitHub verified email address. To become authorized to contribute, you will need to sign the Contributor License Agreement (CLA) as an individual or on behalf of your company. You can read more on Chef's blog.
Non-GitHub Verified Committers
There are 1 commit author(s) whose commits are authored by a non-GitHub verified email address. Chef will have to manually verify that they are authorized to contribute.