Vitalii Elenhaupt
Vitalii Elenhaupt

Reputation: 7326

How to transfer application for deployment to the node with Chef?

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) ?

Upvotes: 1

Views: 407

Answers (1)

John Lemp
John Lemp

Reputation: 5067

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 '[email protected]: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.

Upvotes: 1

Related Questions