This is the default behavior for the git resource. If you take a look at the docs, you’ll see the checkout_branch attribute, whose description reads: “Use to specify the name of a branch to be checked out. Default value: deploy.”
So, instead of using the revision attribute, you may, instead, want to specify the checkout_branch attribute.
What is happening right now is that it’s checking out a branch called deploy from the revision you’ve set, but that’s a bit confusing, based on what you’re expecting to see.
Lead DevOps Engineer
On March 16, 2015 at 3:05:20 AM, Anthony Kong (firstname.lastname@example.org) wrote:
I use this resource to check out my private git project onto to an ec2 instance.
role = ENV[‘TARGET_ROLE’]
git “/home/zeeting/apps/docverter” do
revision role == “uat” ? “dev” : "master"
However when I log in to the box and check the branch, it prints this:
$ git branch
I don’t understand why the branch is set to deploy. It must be a locally created branch because I do not even have a branch called deploy.
I am expecting the branch to be either ‘dev’ or ‘master’
What can cause this behaviour?