Permalink
Browse files

ignore socket files during push

Change-Id: Ia63b687bf106ad2fa9565a148987c1f24c7f2b1d
  • Loading branch information...
1 parent c283385 commit bfeabfa5b274b71efffd6481b03f371f7af7e9cf @vito vito committed Dec 21, 2011
Showing with 14 additions and 3 deletions.
  1. +14 −3 lib/cli/commands/apps.rb
@@ -334,8 +334,7 @@ def check_deploy_directory(path)
err "Can't deploy applications from staging directory: [#{Dir.tmpdir}]"
end
- def check_unreachable_links
- path = Dir.pwd
+ def check_unreachable_links(path)
files = Dir.glob("#{path}/**/*", File::FNM_DOTMATCH)
unreachable_paths = files.select { |f|
File.symlink? f and !Pathname.new(f).realpath.to_s.include? path
@@ -345,6 +344,11 @@ def check_unreachable_links
end
end
+ def find_sockets(path)
+ files = Dir.glob("#{path}/**/*", File::FNM_DOTMATCH)
+ files && files.select { |f| File.socket? f }
+ end
+
def upload_app_bits(appname, path)
display 'Uploading Application:'
@@ -359,12 +363,19 @@ def upload_app_bits(appname, path)
if war_file = Dir.glob('*.war').first
VMC::Cli::ZipUtil.unpack(war_file, explode_dir)
else
- check_unreachable_links
+ check_unreachable_links(path)
FileUtils.mkdir(explode_dir)
+
files = Dir.glob('{*,.[^\.]*}')
+
# Do not process .git files
files.delete('.git') if files
+
FileUtils.cp_r(files, explode_dir)
+
+ find_sockets(explode_dir).each do |s|
+ File.delete s
+ end
end
# Send the resource list to the cloudcontroller, the response will tell us what it already has..

0 comments on commit bfeabfa

Please sign in to comment.