Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Issue using Encrypted bintray key in travis.yml

So When i use the below in .travis.yml it works ..

*********************
    deploy:
      user: mybintrayuserid
      provider: bintray
      file: .bintray_descriptor.yml
      key: myapikey

***********************

but if i change this to below i get error:

**************************
deploy:
  user: mybintrayuserid
  provider: bintray
  file: .bintray_descriptor.yml
  key:
    secure: encryptedHashHash
****************************

Error that i get :

[Bintray Upload] Bintray response: 401 Unauthorized. This resource requires authentication .

How i generated the key :

travis encrypt myapikey --add deploy.key

Note: I've added screenshot too for more details ..

Screenshot : http://i.stack.imgur.com/rhkgJ.png

like image 724
Dhyan Avatar asked Sep 26 '22 20:09

Dhyan


2 Answers

Make sure you use the correct user also.

In my case, I was trying to deploy to a repo owned by an organization, and I wrongly configured the user as the organization name.

Instead of using the organization as the user in your .travis.yml you must use your the username associated with the API key.

I have both the user and the key encrypted - and working.

like image 81
Reinaldo Junior Avatar answered Sep 30 '22 07:09

Reinaldo Junior


FWIW, the same thing happens to me. I assume it's a failure with the Bintray plug-in as the notion of a secure token isn't native to the Bintray API but part of the Travis integration provided by Travis.

like image 24
akutz Avatar answered Sep 30 '22 08:09

akutz