From d0ced4254676df7c88fb02fe0cbed4da0ec66e0c Mon Sep 17 00:00:00 2001 From: James Sutton Date: Fri, 1 May 2020 11:09:58 +0100 Subject: [PATCH 1/3] Issue #1190 - Adding Org and Space to login command Adding the -o and -s arguments to the login command to prevent the cf command from blocking the build indefinitely during login. --- lib/dpl/providers/bluemixcloudfoundry.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dpl/providers/bluemixcloudfoundry.rb b/lib/dpl/providers/bluemixcloudfoundry.rb index b365c7e30..fea084672 100644 --- a/lib/dpl/providers/bluemixcloudfoundry.rb +++ b/lib/dpl/providers/bluemixcloudfoundry.rb @@ -34,7 +34,7 @@ class Bluemixcloudfoundry < Provider cmds install: 'test $(uname) = "Linux" && rel="linux64-binary" || rel="macosx64"; wget "https://cli.run.pivotal.io/stable?release=${rel}&source=github" -qO cf.tgz && tar -zxvf cf.tgz && rm cf.tgz', api: './cf api %{api} %{skip_ssl_validation_opt}', - login: './cf login -u %{username} -p %{password}', + login: './cf login -u %{username} -p %{password} -o %{organization} -s %{space}', target: './cf target -o %{organization} -s %{space}', push: './cf push %{push_args}', logout: './cf logout' From 1602f97a0ea8d9acc1f16ef5c9d3cff4f4e1f559 Mon Sep 17 00:00:00 2001 From: James Sutton Date: Fri, 1 May 2020 11:21:11 +0100 Subject: [PATCH 2/3] Issue #1190 - Adding Quotes for Orgs & Spaces Organization and Space names can have spaces in them which will break the login and target commands. Rather than expecting the user to discover this and fix in their .travis.yml files, it's easy enough to just add the `"` in here. --- lib/dpl/providers/bluemixcloudfoundry.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/dpl/providers/bluemixcloudfoundry.rb b/lib/dpl/providers/bluemixcloudfoundry.rb index fea084672..5f202db16 100644 --- a/lib/dpl/providers/bluemixcloudfoundry.rb +++ b/lib/dpl/providers/bluemixcloudfoundry.rb @@ -34,8 +34,8 @@ class Bluemixcloudfoundry < Provider cmds install: 'test $(uname) = "Linux" && rel="linux64-binary" || rel="macosx64"; wget "https://cli.run.pivotal.io/stable?release=${rel}&source=github" -qO cf.tgz && tar -zxvf cf.tgz && rm cf.tgz', api: './cf api %{api} %{skip_ssl_validation_opt}', - login: './cf login -u %{username} -p %{password} -o %{organization} -s %{space}', - target: './cf target -o %{organization} -s %{space}', + login: './cf login -u %{username} -p %{password} -o "%{organization}" -s "%{space}"', + target: './cf target -o "%{organization}" -s "%{space}"', push: './cf push %{push_args}', logout: './cf logout' From 81a57f75fcde3a5b1fa9a783c69e54df76928a38 Mon Sep 17 00:00:00 2001 From: James Sutton Date: Fri, 1 May 2020 12:49:22 +0100 Subject: [PATCH 3/3] Issue #1190 - modifying tests for Fix Modifying the tests to check the commands correctly. --- spec/dpl/providers/bluemixcloudfoundry_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/dpl/providers/bluemixcloudfoundry_spec.rb b/spec/dpl/providers/bluemixcloudfoundry_spec.rb index b24fc3548..c7deb7a8c 100644 --- a/spec/dpl/providers/bluemixcloudfoundry_spec.rb +++ b/spec/dpl/providers/bluemixcloudfoundry_spec.rb @@ -9,8 +9,8 @@ describe 'by default', record: true do it { should have_run %r(wget .*cli.run.pivotal.io.* -qO cf.tgz && tar -zxvf cf.tgz) } it { should have_run './cf api api.ng.bluemix.net' } - it { should have_run './cf login -u name -p pass' } - it { should have_run './cf target -o org -s space' } + it { should have_run './cf login -u name -p pass -o "org" -s "space"' } + it { should have_run './cf target -o "org" -s "space"' } it { should have_run './cf push' } it { should have_run './cf logout' } it { should have_run_in_order }