- From: Daniel DeLeo <
>
- To:
- Subject: [chef] Re: Re: git branch questions
- Date: Fri, 11 Apr 2014 08:09:12 -0700
Actually, Jenn was on the right track. See the ticket here which has some
discussion about the use case and usage:
https://tickets.opscode.com/browse/CHEF-3734
Jenn, I think you’re probably on too old a version of Chef to use this
feature. You need at least 11.10. I think you also need to add
`enable_checkout false` to your git resource to have it use the default
branch from the upstream.
--
Daniel DeLeo
On Friday, April 11, 2014 at 8:02 AM, Jeff Byrnes wrote:
>
Jenn:
>
You’ll actually want to use something like this:
>
git '/opt/test' do repository 'git://github.com/Production/test.git'
>
(http://github.com/Production/test.git') revision 'production' action :sync
>
user 'test' end
>
or this:
>
git '/opt/test' do repository 'git://github.com/Production/test.git'
>
(http://github.com/Production/test.git') checkout_branch 'production'
>
action :sync user 'test' end
>
There’s no branch attribute, so you’re ending up with the default value for
>
the checkout_branch attribute, which is deploy.
>
See the docs for the git resource’s attributes for more details.
>
>
>
-- Jeff Byrnes
>
@berkleebassist (http://twitter.com/berkleebassist)
>
Operations Engineer
>
EverTrue (http://www.evertrue.com/)
>
704.516.4628
>
>
>
>
On April 11, 2014 at 10:54:22 AM, Jenn Fountain
>
(
>
>
(mailto:
))
>
wrote:
>
>
> Ohai,
>
>
>
> I am using the following to check out code:
>
>
>
> git '/opt/test' do
>
> repository 'git://github.com/Production/test.git'
>
> (http://github.com/Production/test.git')
>
> branch 'production'
>
> action :sync
>
> user ‘test'
>
> end
>
>
>
> this results in this:
>
>
>
>
>
> test]# git branch
>
> * deploy
>
> staging
>
>
>
>
>
> this command:
>
>
>
> git clone -b production git://github.com/Production/test.git
>
> (http://github.com/Production/test.git) test2
>
>
>
> test2]# git branch
>
> * production
>
>
>
> This is causing concern because the devs aren’t 100% sure if this the
>
> production branch or not. Is this normal? Did I miss something? Am I
>
> doing something wrong? I tried checkout_branch and get this:
>
>
>
> undefined method `checkout_branch' for Chef::Resource::Git
>
>
>
> Any help would be appreciated.
Archive powered by MHonArc 2.6.16.