- From: Daniel DeLeo <
>
- To:
- Subject: [chef] Re: Re: Re: Re: Strange git behavior - any suggestion is welcome
- Date: Mon, 16 Mar 2015 17:47:30 -0700
On Monday, March 16, 2015 at 5:32 PM, Anthony Kong wrote:
>
Hi Jeff and Daniel,
>
>
Thanks very much for the answer!
>
>
According to an example on the resource_git page (reproduced here)
>
>
if node.chef_environment == "QA" branch_name = "staging" else branch_name =
>
"master" end git "/home/user/deployment" do repository
>
"
>
>
(mailto:
):gitsite/deployment.git"
>
revision branch_name action :sync user "user" group "test" end
>
>
It seems to suggest revision can be used to specify a branch.
>
>
>
>
Now I switched to use checkout_branch, and I get this error:
>
>
==> default: [2015-03-17T00:09:53+00:00] ERROR: Converge failed with error
>
message git[/home/work/apps/project] (work::project line 19) had an error:
>
Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0],
>
but received '128'
>
==> default: ---- Begin output of git branch -f master
>
6c97fdd97a814dc5db5523322d9b4b90196645bf ----
>
==> default: STDOUT:
>
==> default: STDERR: fatal: Cannot force update the current branch.
>
>
Is the 'sync' action not compatible to the checkout_branch?
>
>
Cheers
>
I forgot you need to set `enable_checkout false` as well, or else you get the
same behavior as before except the branch is named whatever you specified in
`checkout_branch` rather than “deploy”
Again, this is really just a special case for setting up developer laptops,
if the branch name doesn’t REALLY matter, then the default behavior is what
you should be using.
HTH,
--
Daniel DeLeo
Archive powered by MHonArc 2.6.16.