1

I want to deploy recently built application on Chef node from the workstation. I can execute my chef cookbook as follows:

knife ssh {{node_address}} 'sudo chef-client' --manual-list --ssh-user {{user}} --ssh-password '{{password}}'

But what is the best way to transfer my application for deployment (zipped file, over 300 mb) ?

Vitalii Elenhaupt
  • 7,146
  • 3
  • 27
  • 43
  • Does this help? http://stackoverflow.com/questions/19221252/how-to-move-copy-files-locally-with-chef/19222641#19222641 – Jordan Running Jul 07 '15 at 17:57
  • @Jordan Not sure. A bash resource defines the desired state for a single configuration item present on a node, but that file on my workstation. Could you please clarify how this can help ? – Vitalii Elenhaupt Jul 07 '15 at 18:06
  • The top answer on that page describes how to copy a file from your workstation to the node; the answer I linked to describes how to unzip it. Sorry if that wasn't clear. – Jordan Running Jul 07 '15 at 18:09

1 Answers1

1

Generally the application that you are trying to deploy should be hosted somewhere that is accessible from the node. You want it to be someplace that is consistent and reliable, as every time you run chef it is going to want to ensure the resource you are deploying is it the desired state. There are many ways this can be achieved depending on the type of application it is. Examples include putting it in a git repository, a package manager (apt/yum), an artifact server or even as simple as a zip on http server or amazon s3.

A common approach for git would be to use the deploy resource built into chef

deploy 'private_repo' do
  repo 'git@github.com:acctname/private-repo.git'
  deploy_to '/tmp/private_code' 
  action :deploy
end

Another common approach is the ark cookbook which can easily manage tar/zipped resources or even the artifact cookbook which can deploy artifacts from nexus or s3.

John Lemp
  • 5,029
  • 3
  • 28
  • 36