[chef] Re: Re: Re: Re: Re: Re: Issue deploying with application cookbook - STDERR: fatal: reference is not a tree: af5c7ff84dd852cf1c0b5ca60ea92546a20dda01


Chronological Thread 
  • From: Cassiano Leal < >
  • To: < >
  • Cc:
  • Subject: [chef] Re: Re: Re: Re: Re: Re: Issue deploying with application cookbook - STDERR: fatal: reference is not a tree: af5c7ff84dd852cf1c0b5ca60ea92546a20dda01
  • Date: Wed, 24 Jul 2013 10:54:00 -0300

It works:


:/tmp$ COMMIT_ID=`git ls-remote :zynkmobile/resourcemanager.git develop`

:/tmp$ git clone :zynkmobile/resourcemanager.git

Cloning into 'resourcemanager'...

remote: Counting objects: 1703, done.

remote: Compressing objects: 100% (729/729), done.

remote: Total 1703 (delta 1193), reused 1349 (delta 948)

Receiving objects: 100% (1703/1703), 20.07 MiB | 183 KiB/s, done.

Resolving deltas: 100% (1193/1193), done.

:/tmp$ cd resourcemanager/

:/tmp/resourcemanager$ git checkout -b deploy $COMMIT_ID

fatal: Cannot update paths and switch to branch 'deploy' at the same time.

Did you intend to checkout 'refs/heads/develop' which can not be resolved as commit?

:/tmp/resourcemanager$ echo $COMMIT_ID

af5c7ff84dd852cf1c0b5ca60ea92546a20dda01 refs/heads/develop

:/tmp/resourcemanager$ git checkout -b deploy `echo $COMMIT_ID | cut -d' ' -f1`

Switched to a new branch 'deploy'

:/tmp/resourcemanager$


Another interesting thing is that if I list branched on this manually cloned repo, here’s what I get:


:/tmp/resourcemanager$ git branch -a

* deploy

  master

  remotes/origin/HEAD -> origin/master

  remotes/origin/develop

  remotes/origin/master



On the one that was cloned by Chef, on the other hand:


:/opt/apps/resourcemanager/shared/cached-copy$ git branch -a

* master

  remotes/origin/HEAD -> origin/master

  remotes/origin/master


The develop branch is not present. My only guess is that Chef’s way of cloning does not clone the whole thing, and for some reason leaves the branch I need out.


--
Cassiano Leal
http://cassianoleal.com
http://twitter.com/cassianoleal

On July 23, 2013 at 22:07:47, Daniel DeLeo ( ) wrote:

On Tuesday, July 23, 2013 at 2:05 PM, Cassiano Leal wrote:

Seems relevant to add — I’m referencing the branch name:


application_ruby “resourcemanager” do

  …

  revision ‘develop’

  …

end


Could this be the source of my problems? If so, how do I fix it, or what should I be passing to ‘revision’ instead of the branch name?

It shouldn't matter how you specify the revision. If it's not a commit hash, the provider uses git ls-remote to figure out what the commit is, then uses that from then on.

Looks like the repo you get from `git clone` doesn't contain the SHA it's supposed to have, which is pretty odd since a subsequent `git fetch` picks it up. From the command line, with the same git version, does it fail if you 

COMMIT_ID = git ls-remote GIT_URL BRANCH
git clone REPO
git checkout -b deploy COMMIT_ID


-- 
Daniel DeLeo





Archive powered by MHonArc 2.6.16.

§