2

I'm trying to deploy an app from Travis to Cloud Foundry.

My .travis.yml looks like this:

deploy:
  provider: cloudfoundry
  api: https://api.run.pivotal.io
  username:
    secure: "... secure username, generated with travis cli"
  password:
    secure: "... secure password, generated with travis cli"
  organization: my-org
  space: development
  on:
    repo: username/repository
    branch: master

Organization, space, repository, encrypted username and password are double checked and are correct.

Yet, travis log tells me:

Installing deploy dependencies
Preparing deploy
cf
Setting api endpoint to https://api.run.pivotal.io...
OK

API endpoint:   https://api.run.pivotal.io (API version: 2.37.0)   
Not logged in. Use 'cf login' to log in.
API endpoint: https://api.run.pivotal.io
Authenticating...
Credentials were rejected, please try again.

Logging in manually works like a charm. Anyone an idea what the problem could be?

I'm not sure whether it's me, travis or cloud foundry (PWS) that cocks up.

bengro
  • 1,004
  • 10
  • 19
  • Have you checked out these docs: http://docs.travis-ci.com/user/deployment/cloudfoundry/. Looks like you might need to add `edge: true`, and also perhaps not encrypt your username? – Amit Kumar Gupta Oct 03 '15 at 20:18
  • Yes. I have tried with and without edge: true - with no luck. I have also tried plain/encrypted username - neither worked. – bengro Oct 04 '15 at 20:09
  • I ran into the same issue and discovered that I had special characters in my password. If you have them, at the command line you need to enclose your password in quotes and escape the special characters. – Erds Oct 05 '15 at 20:35
  • you made my day! that is it! please add an official answer, and I'll mark it as answered. – bengro Oct 06 '15 at 21:19

1 Answers1

3

I ran into the same issue and discovered that I had special characters in my password.

If your password contains special characters, then when calling travis encrypt at the command line you need to enclose your password in quotes and escape the special characters.

Details can be seen here: http://docs.travis-ci.com/user/encryption-keys/#Note-on-escaping-certain-symbols

Erds
  • 513
  • 5
  • 16