Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bluemixcloudfoundry provider freezes build on cf login step #1190

Closed
jpwsutton opened this issue May 1, 2020 · 1 comment · May be fixed by #1191
Closed

bluemixcloudfoundry provider freezes build on cf login step #1190

jpwsutton opened this issue May 1, 2020 · 1 comment · May be fixed by #1191
Labels

Comments

@jpwsutton
Copy link

Hi, I'm using the bluemixcloudfoundry provider in my automated deployment and have found an issue that I think should be a fairly straightforward fix:

When the provider issues the cf login command, in my case it interactively requests which organization we are logging into and so the build freezes.

Log:

Authenticate deployment
$ ./cf api api.eu-gb.bluemix.net
Setting api endpoint to api.eu-gb.bluemix.net...
OK
api endpoint:   https://api.eu-gb.bluemix.net
api version:    2.147.0
Not logged in. Use 'cf login' or 'cf login --sso' to log in.
$ ./cf login -u apikey -p ********************
API endpoint: https://api.eu-gb.bluemix.net
Authenticating...
OK
Select an org:
1. One of My Orgs
2. Another Organization
3. Personal Projects

I believe that the login command should also use the -o argument to select the Organization so that it doesn't prompt for it. It might be worth adding the -s space argument in as well.

I think the fix should be here: https://github.com/travis-ci/dpl/blob/master/lib/dpl/providers/bluemixcloudfoundry.rb#L37

Change the line to:

login:   './cf login -u %{username} -p %{password} -o %{organization} -s %{space}',

I'm happy to submit a PR, but thought it best to run it past the travis team in an issue first.

jpwsutton added a commit to jpwsutton/dpl that referenced this issue May 1, 2020
Adding the -o and -s arguments to the login command to prevent the cf command from blocking the build indefinitely during login.
jpwsutton added a commit to jpwsutton/dpl that referenced this issue May 1, 2020
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.
jpwsutton added a commit to jpwsutton/dpl that referenced this issue May 1, 2020
Modifying the tests to check the commands correctly.
@stale
Copy link

stale bot commented Aug 1, 2020

Thanks for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please do feel free to either reopen this issue or open a new one. We'll gladly take a look again! You can read more here: https://blog.travis-ci.com/2018-03-09-closing-old-issues

@stale stale bot added the stale label Aug 1, 2020
@stale stale bot closed this as completed Aug 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant