Comments (11)
Ran into this recently when testing deploys on ubuntu 14.04, seems the issue arose when git learnt the --single-branch
flag in 1.7.10
and the default behaviour changed. The most recent git package on 12.04 was 1.7.9
so we'd never run into the issue there.
Your suggestion fixes the initial deploy, but if the next deploy switches branch you run into the same issue. I think the flag to use is --no-single-branch
which ensures you get the tip of all current branches which I believe was standard git behaviour prior to git 1.7.10
. Unfortunately, because that flag doesn't exist in versions prior to that, there likely needs to be some git version detection to avoid breaking deploy for machines still using old version of git.
from chef.
@vitaliel thanks for the issue. Would be great if you can take a stab at adding the additional parameter for -b branch_name
. Let us know if you need some pointers to get started.
from chef.
Any update on this?
from chef.
Anyone have a suggested workaround for this issue, given i have several cookbooks we use to deploy code internally that are broken by this bug.
from chef.
You can work around in the short term with shallow_clone false
, your deploy will take longer, but it mitigates the problem. Obviously depending on the size of the repo in question, this may or may not be viable.
The more hardcore solution is a total hack; works by monkey patching the resource to inject the necessary switch. However be warned this will break deploys on any machine using a version of git prior to 1.7.10
. If you're happy with that you should be able to create an rb
file in your cookbook's libraries
directory containing:
class Chef
class Resource
class Deploy < Chef::Resource
def depth
@shallow_clone ? "5 --no-single-branch" : nil
end
end
end
end
You might need to play with that a bit as I only gave it a cursory test a month or so ago and just rewrote it from memory.
P.S. You could probably add some version check conditional to the hack if you need to support older git versions.
from chef.
Thanks! that almost worked, with a small tweek i got something that gets me out of this bind until a better solution is found!
class Chef
class Resource
class Deploy < Chef::Resource
def depth
if node[:platform_version].to_i >= 14.04 && node[:platform] == "ubuntu"
@shallow_clone ? "--depth 5 --no-single-branch" : nil
end
end
end
end
end
from chef.
Has a official fix for this issue been identified? As a side note the fix above works great for simple cookbooks, however on a more complex cookbook, with a non default.rb recipe this fix seems to fail.
from chef.
Any idea of the priority of this?
from chef.
based on the lack of response I'm going to guess opscode is not going to fix this
from chef.
@neallawson Fixed in master.
from chef.
@randomcamel Thank You! this will make my life much easer!!!!
from chef.
Related Issues (20)
- SonarQube config broken for internal contributors
- Node object has tag but no untag
- Mutating operations on Node attribute Arrays are not triggering "attribute_changed" event
- Invalid cpu_quota setting HOT 1
- reset_property raising NoMethodError exception
- homebrew_update TypeError when running under launchd HOT 3
- Omnitruck artifact does not exist for Rocky Linux HOT 11
- Expose "--filter-waived-controls" option to chef client compliance phase
- Mount resource failing to execute after first run. HOT 1
- only_if / not_if command guard with lazy behavior
- Hostname resource does not set fqdn on MacOS/Darwin HOT 1
- bundle exec knife fail with attempt to use deprecated `untaint` method HOT 1
- `openssl_x509_certificate` handles CN in a way that violates the x509 spec
- sleep is not a built-in Windows command. This depends on Win2K3 resource kit. Suggest timeout be used instead. HOT 3
- Chef fails with inspec 6.6 HOT 1
- Cannot build chef from source using `omnibus`
- Cannot build chef from source using `omnibus` HOT 1
- Sensitive properties of custom resources leaked via failed regex constraints
- windows_security_policy incorrectly reporting updates
- Net::HTTPServerException: 405 "Not Allowed" while saving node at the end of a chef-client run / node bootstrap HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chef.