Problem with deploy_branch


#1

Here is the recipe I am having problems with:

deploy_branch node[:app][:frontend][:directory] do
repository node[:app][:git_repository]
ssh_wrapper node[:app][:git_ssh_wrapper]
branch node[:app][:branch]
enable_submodules true

user 'app’
group ‘nginx’

create_dirs_before_symlink.clear
purge_before_symlink %w{log}
symlink_before_migrate.clear
symlinks({‘log’ => ‘log’})

action :deploy
end

It is creating a copy of repository_cache but seems to be keeping older files and causing code conflicts and issues. I am running nginx and php_fpm.

Is anyone aware of any issues with what I am doing or is there an known issue? Anyone to disable repo_cache?

Thanks for any help!
Jenn


#2

On Wednesday, September 25, 2013 at 6:44 PM, Jenn Fountain wrote:

Here is the recipe I am having problems with:

deploy_branch node[:app][:frontend][:directory] do
repository node[:app][:git_repository]
ssh_wrapper node[:app][:git_ssh_wrapper]
branch node[:app][:branch]
enable_submodules true

user 'app’
group ‘nginx’

create_dirs_before_symlink.clear
purge_before_symlink %w{log}
symlink_before_migrate.clear
symlinks({‘log’ => ‘log’})

action :deploy
end

It is creating a copy of repository_cache but seems to be keeping older files and causing code conflicts and issues. I am running nginx and php_fpm.
Can you be more specific? Is Chef giving you an error message? What behavior are you expecting, and how is it different from the behavior you’re observing?

Is anyone aware of any issues with what I am doing or is there an known issue? Anyone to disable repo_cache?
If you don’t need all of the features of the deploy resource, you can roll you own deployment by using the git resource directly.

Thanks for any help!
Jenn


Daniel DeLeo


#3

On Sep 26, 2013, at 1:27 PM, Daniel DeLeo dan@kallistec.com wrote:

On Wednesday, September 25, 2013 at 6:44 PM, Jenn Fountain wrote:

Here is the recipe I am having problems with:

deploy_branch node[:app][:frontend][:directory] do
repository node[:app][:git_repository]
ssh_wrapper node[:app][:git_ssh_wrapper]
branch node[:app][:branch]
enable_submodules true

user 'app’
group ‘nginx’

create_dirs_before_symlink.clear
purge_before_symlink %w{log}
symlink_before_migrate.clear
symlinks({‘log’ => ‘log’})

action :deploy
end

It is creating a copy of repository_cache but seems to be keeping older files and causing code conflicts and issues. I am running nginx and php_fpm.
Can you be more specific? Is Chef giving you an error message? What behavior are you expecting, and how is it different from the behavior you’re observing?

We removed certain modules in the .gitmodules file but they still existed in the new revisions and existed in cache-copy.

Is anyone aware of any issues with what I am doing or is there an known issue? Anyone to disable repo_cache?
If you don’t need all of the features of the deploy resource, you can roll you own deployment by using the git resource directly.

I do like the features - symlink, etc. I would like to continue using it. Open for suggestion now.

Thanks for any help!
Jenn


Daniel DeLeo


#4

On Thursday, September 26, 2013 at 11:58 AM, Jenn Fountain wrote:

It is creating a copy of repository_cache but seems to be keeping older files and causing code conflicts and issues. I am running nginx and php_fpm.
Can you be more specific? Is Chef giving you an error message? What behavior are you expecting, and how is it different from the behavior you’re observing?

We removed certain modules in the .gitmodules file but they still existed in the new revisions and existed in cache-copy.

Git submodules are generally a huge headache. As you can see here: https://git.wiki.kernel.org/index.php/GitSubmoduleTutorial (at the bottom) git doesn’t automatically remove them, they become untracked files. So you’ll need custom code to remove them, probably in one of the deploy resource callbacks. You may be able to accomplish this using git clean but that could remove files you want to keep. You probably will need to experiment a bit to find the best approach for your application and team.


Daniel DeLeo