cfoundry 0.6.0.rc4 → 0.6.0.rc5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/cc_api_stub/login.rb +1 -1
- data/lib/cfoundry/uaaclient.rb +1 -1
- data/lib/cfoundry/upload_helpers.rb +5 -5
- data/lib/cfoundry/version.rb +1 -1
- data/spec/cfoundry/uaaclient_spec.rb +1 -1
- data/spec/cfoundry/upload_helpers_spec.rb +6 -6
- data/spec/fixtures/apps/{with_vmcignore → with_cfignore}/ambiguous_ignored +0 -0
- data/spec/fixtures/apps/{with_vmcignore → with_cfignore}/ignored_dir/file_in_ignored_dir.txt +0 -0
- data/spec/fixtures/apps/{with_vmcignore → with_cfignore}/ignored_file.txt +0 -0
- data/spec/fixtures/apps/{with_vmcignore → with_cfignore}/non_ignored_dir/file_in_non_ignored_dir.txt +0 -0
- data/spec/fixtures/apps/{with_vmcignore → with_cfignore}/non_ignored_dir/ignored_file.txt +0 -0
- data/spec/fixtures/apps/{with_vmcignore → with_cfignore}/non_ignored_dir/toplevel_ignored.txt +0 -0
- data/spec/fixtures/apps/{with_vmcignore → with_cfignore}/non_ignored_file.txt +0 -0
- data/spec/fixtures/apps/{with_vmcignore → with_cfignore}/toplevel_ignored.txt +0 -0
- metadata +20 -20
data/lib/cc_api_stub/login.rb
CHANGED
@@ -13,7 +13,7 @@ module CcApiStub
|
|
13
13
|
WebMock::API.stub_request(:post, %r{uaa.localhost/oauth/authorize}).
|
14
14
|
to_return(
|
15
15
|
:status => 302,
|
16
|
-
:headers => {"Location" => "https://uaa.localhost/redirect/
|
16
|
+
:headers => {"Location" => "https://uaa.localhost/redirect/cf#access_token=sre-admin-access-token&token_type=bearer"}
|
17
17
|
)
|
18
18
|
end
|
19
19
|
end
|
data/lib/cfoundry/uaaclient.rb
CHANGED
@@ -5,7 +5,7 @@ module CFoundry
|
|
5
5
|
class UAAClient
|
6
6
|
attr_accessor :target, :client_id, :token, :trace
|
7
7
|
|
8
|
-
def initialize(target = "https://uaa.cloudfoundry.com", client_id = "
|
8
|
+
def initialize(target = "https://uaa.cloudfoundry.com", client_id = "cf")
|
9
9
|
@target = target
|
10
10
|
@client_id = client_id
|
11
11
|
CF::UAA::Misc.symbolize_keys = true
|
@@ -20,7 +20,7 @@ module CFoundry
|
|
20
20
|
# A path pointing to either a directory, or a .jar, .war, or .zip
|
21
21
|
# file.
|
22
22
|
#
|
23
|
-
# If a .
|
23
|
+
# If a .cfignore file is detected under the given path, it will be used
|
24
24
|
# to exclude paths from the payload, similar to a .gitignore.
|
25
25
|
#
|
26
26
|
# [check_resources]
|
@@ -34,7 +34,7 @@ module CFoundry
|
|
34
34
|
end
|
35
35
|
|
36
36
|
zipfile = "#{Dir.tmpdir}/#{@guid}.zip"
|
37
|
-
tmpdir = "#{Dir.tmpdir}/.
|
37
|
+
tmpdir = "#{Dir.tmpdir}/.cf_#{@guid}_files"
|
38
38
|
|
39
39
|
FileUtils.rm_f(zipfile)
|
40
40
|
FileUtils.rm_rf(tmpdir)
|
@@ -56,14 +56,14 @@ module CFoundry
|
|
56
56
|
def prepare_package(path, to)
|
57
57
|
if path =~ /\.(jar|war|zip)$/
|
58
58
|
CFoundry::Zip.unpack(path, to)
|
59
|
-
elsif war_file = Dir.glob("#{path}/*.war").first
|
59
|
+
elsif (war_file = Dir.glob("#{path}/*.war").first)
|
60
60
|
CFoundry::Zip.unpack(war_file, to)
|
61
61
|
else
|
62
62
|
FileUtils.mkdir(to)
|
63
63
|
|
64
64
|
exclude = UPLOAD_EXCLUDE
|
65
|
-
if File.exists?("#{path}/.
|
66
|
-
exclude += File.read("#{path}/.
|
65
|
+
if File.exists?("#{path}/.cfignore")
|
66
|
+
exclude += File.read("#{path}/.cfignore").split(/\n+/)
|
67
67
|
end
|
68
68
|
|
69
69
|
files = files_to_consider(path, exclude)
|
data/lib/cfoundry/version.rb
CHANGED
@@ -68,7 +68,7 @@ EOF
|
|
68
68
|
let(:password) { "test" }
|
69
69
|
let(:creds) { {:username => username, :password => password} }
|
70
70
|
let(:state) { 'somestate' }
|
71
|
-
let(:redirect_uri) { 'https://uaa.cloudfoundry.com/redirect/
|
71
|
+
let(:redirect_uri) { 'https://uaa.cloudfoundry.com/redirect/cf' }
|
72
72
|
let(:auth) { Object.new }
|
73
73
|
let(:issuer) { Object.new }
|
74
74
|
|
@@ -4,7 +4,7 @@ describe CFoundry::UploadHelpers do
|
|
4
4
|
describe '#upload' do
|
5
5
|
let(:base) { Object.new }
|
6
6
|
let(:guid) { "123" }
|
7
|
-
let(:path) { "#{SPEC_ROOT}/fixtures/apps/
|
7
|
+
let(:path) { "#{SPEC_ROOT}/fixtures/apps/with_cfignore" }
|
8
8
|
let(:check_resources) { false }
|
9
9
|
let(:tmpdir) { "#{SPEC_ROOT}/tmp/fake_tmpdir" }
|
10
10
|
|
@@ -95,11 +95,11 @@ describe CFoundry::UploadHelpers do
|
|
95
95
|
subject
|
96
96
|
end
|
97
97
|
|
98
|
-
it 'does not include files and directories specified in the
|
98
|
+
it 'does not include files and directories specified in the cfignore' do
|
99
99
|
mock_zip do |src, _|
|
100
100
|
files = relative_glob(src)
|
101
101
|
expect(files).to match_array(%w[
|
102
|
-
.hidden_file .
|
102
|
+
.hidden_file .cfignore non_ignored_dir ambiguous_ignored
|
103
103
|
non_ignored_dir/file_in_non_ignored_dir.txt non_ignored_file.txt
|
104
104
|
non_ignored_dir/toplevel_ignored.txt
|
105
105
|
])
|
@@ -140,7 +140,7 @@ describe CFoundry::UploadHelpers do
|
|
140
140
|
|
141
141
|
stub(base).resource_match(anything) do
|
142
142
|
%w{ xyz foo/bar/baz/fizz }.map do |path|
|
143
|
-
{ :fn => "#{tmpdir}/.
|
143
|
+
{ :fn => "#{tmpdir}/.cf_#{guid}_files/#{path}" }
|
144
144
|
end
|
145
145
|
end
|
146
146
|
|
@@ -161,7 +161,7 @@ describe CFoundry::UploadHelpers do
|
|
161
161
|
|
162
162
|
stub(base).resource_match(anything) do
|
163
163
|
%w{ xyz }.map do |path|
|
164
|
-
{ :fn => "#{tmpdir}/.
|
164
|
+
{ :fn => "#{tmpdir}/.cf_#{guid}_files/#{path}" }
|
165
165
|
end
|
166
166
|
end
|
167
167
|
|
@@ -182,7 +182,7 @@ describe CFoundry::UploadHelpers do
|
|
182
182
|
}.to raise_error(CFoundry::Error, /contains links.*that point outside/)
|
183
183
|
end
|
184
184
|
|
185
|
-
context "and it is
|
185
|
+
context "and it is cfignored" do
|
186
186
|
let(:path) { "#{SPEC_ROOT}/fixtures/apps/with_ignored_external_symlink" }
|
187
187
|
|
188
188
|
it "ignores it" do
|
File without changes
|
data/spec/fixtures/apps/{with_vmcignore → with_cfignore}/ignored_dir/file_in_ignored_dir.txt
RENAMED
File without changes
|
File without changes
|
data/spec/fixtures/apps/{with_vmcignore → with_cfignore}/non_ignored_dir/file_in_non_ignored_dir.txt
RENAMED
File without changes
|
File without changes
|
data/spec/fixtures/apps/{with_vmcignore → with_cfignore}/non_ignored_dir/toplevel_ignored.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cfoundry
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 2837035787
|
5
5
|
prerelease: 6
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 6
|
9
9
|
- 0
|
10
10
|
- rc
|
11
|
-
-
|
12
|
-
version: 0.6.0.
|
11
|
+
- 5
|
12
|
+
version: 0.6.0.rc5
|
13
13
|
platform: ruby
|
14
14
|
authors:
|
15
15
|
- Cloud Foundry Team
|
@@ -18,7 +18,7 @@ autorequire:
|
|
18
18
|
bindir: bin
|
19
19
|
cert_chain: []
|
20
20
|
|
21
|
-
date: 2013-03-
|
21
|
+
date: 2013-03-22 00:00:00 Z
|
22
22
|
dependencies:
|
23
23
|
- !ruby/object:Gem::Dependency
|
24
24
|
name: multipart-post
|
@@ -283,19 +283,19 @@ files:
|
|
283
283
|
- spec/fakes/service_plan_fake.rb
|
284
284
|
- spec/fakes/space_fake.rb
|
285
285
|
- spec/fakes/user_fake.rb
|
286
|
+
- spec/fixtures/apps/with_cfignore/ambiguous_ignored
|
287
|
+
- spec/fixtures/apps/with_cfignore/ignored_dir/file_in_ignored_dir.txt
|
288
|
+
- spec/fixtures/apps/with_cfignore/ignored_file.txt
|
289
|
+
- spec/fixtures/apps/with_cfignore/non_ignored_dir/file_in_non_ignored_dir.txt
|
290
|
+
- spec/fixtures/apps/with_cfignore/non_ignored_dir/ignored_file.txt
|
291
|
+
- spec/fixtures/apps/with_cfignore/non_ignored_dir/toplevel_ignored.txt
|
292
|
+
- spec/fixtures/apps/with_cfignore/non_ignored_file.txt
|
293
|
+
- spec/fixtures/apps/with_cfignore/toplevel_ignored.txt
|
286
294
|
- spec/fixtures/apps/with_dotfiles/xyz
|
287
295
|
- spec/fixtures/apps/with_external_symlink/foo
|
288
296
|
- spec/fixtures/apps/with_ignored_external_symlink/foo
|
289
297
|
- spec/fixtures/apps/with_nested_directories/foo/bar/baz/fizz
|
290
298
|
- spec/fixtures/apps/with_nested_directories/xyz
|
291
|
-
- spec/fixtures/apps/with_vmcignore/ambiguous_ignored
|
292
|
-
- spec/fixtures/apps/with_vmcignore/ignored_dir/file_in_ignored_dir.txt
|
293
|
-
- spec/fixtures/apps/with_vmcignore/ignored_file.txt
|
294
|
-
- spec/fixtures/apps/with_vmcignore/non_ignored_dir/file_in_non_ignored_dir.txt
|
295
|
-
- spec/fixtures/apps/with_vmcignore/non_ignored_dir/ignored_file.txt
|
296
|
-
- spec/fixtures/apps/with_vmcignore/non_ignored_dir/toplevel_ignored.txt
|
297
|
-
- spec/fixtures/apps/with_vmcignore/non_ignored_file.txt
|
298
|
-
- spec/fixtures/apps/with_vmcignore/toplevel_ignored.txt
|
299
299
|
- spec/fixtures/empty_file
|
300
300
|
- spec/fixtures/fake_cc_application.json
|
301
301
|
- spec/fixtures/fake_cc_application_summary.json
|
@@ -413,19 +413,19 @@ test_files:
|
|
413
413
|
- spec/fakes/service_plan_fake.rb
|
414
414
|
- spec/fakes/space_fake.rb
|
415
415
|
- spec/fakes/user_fake.rb
|
416
|
+
- spec/fixtures/apps/with_cfignore/ambiguous_ignored
|
417
|
+
- spec/fixtures/apps/with_cfignore/ignored_dir/file_in_ignored_dir.txt
|
418
|
+
- spec/fixtures/apps/with_cfignore/ignored_file.txt
|
419
|
+
- spec/fixtures/apps/with_cfignore/non_ignored_dir/file_in_non_ignored_dir.txt
|
420
|
+
- spec/fixtures/apps/with_cfignore/non_ignored_dir/ignored_file.txt
|
421
|
+
- spec/fixtures/apps/with_cfignore/non_ignored_dir/toplevel_ignored.txt
|
422
|
+
- spec/fixtures/apps/with_cfignore/non_ignored_file.txt
|
423
|
+
- spec/fixtures/apps/with_cfignore/toplevel_ignored.txt
|
416
424
|
- spec/fixtures/apps/with_dotfiles/xyz
|
417
425
|
- spec/fixtures/apps/with_external_symlink/foo
|
418
426
|
- spec/fixtures/apps/with_ignored_external_symlink/foo
|
419
427
|
- spec/fixtures/apps/with_nested_directories/foo/bar/baz/fizz
|
420
428
|
- spec/fixtures/apps/with_nested_directories/xyz
|
421
|
-
- spec/fixtures/apps/with_vmcignore/ambiguous_ignored
|
422
|
-
- spec/fixtures/apps/with_vmcignore/ignored_dir/file_in_ignored_dir.txt
|
423
|
-
- spec/fixtures/apps/with_vmcignore/ignored_file.txt
|
424
|
-
- spec/fixtures/apps/with_vmcignore/non_ignored_dir/file_in_non_ignored_dir.txt
|
425
|
-
- spec/fixtures/apps/with_vmcignore/non_ignored_dir/ignored_file.txt
|
426
|
-
- spec/fixtures/apps/with_vmcignore/non_ignored_dir/toplevel_ignored.txt
|
427
|
-
- spec/fixtures/apps/with_vmcignore/non_ignored_file.txt
|
428
|
-
- spec/fixtures/apps/with_vmcignore/toplevel_ignored.txt
|
429
429
|
- spec/fixtures/empty_file
|
430
430
|
- spec/fixtures/fake_cc_application.json
|
431
431
|
- spec/fixtures/fake_cc_application_summary.json
|