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

upload to bintray #15

Closed
caarlos0 opened this issue Dec 31, 2016 · 26 comments
Closed

upload to bintray #15

caarlos0 opened this issue Dec 31, 2016 · 26 comments
Labels
docs A problem or enhancement in documentation hacktoberfest wontfix This will not be worked on
Milestone

Comments

@caarlos0
Copy link
Member

caarlos0 commented Dec 31, 2016

maybe it is a cool feature to add...

@caarlos0 caarlos0 changed the title upload to bintray? upload to bintray Dec 31, 2016
@bpicode
Copy link
Contributor

bpicode commented Jan 1, 2017

...it is IMO. Bintray has a very nice API and many cool features beyond plain binary storage [1, 2]. In order to unlock some these one may have to add opkg/deb/rpm packaging to GoReleaser.

[1] https://blog.bintray.com/2016/07/12/developing-for-openwrt-bintray-has-an-opkg-for-you/
[2] https://blog.bintray.com/2014/12/16/hosting-debian-packages-on-bintray-rocks/

@caarlos0 caarlos0 added this to the v2.0.0 milestone Apr 9, 2017
@suntong
Copy link

suntong commented Aug 12, 2017

I gave it a try and it is pretty straightforward -- the second blog entry listed by @bpicode, https://blog.bintray.com/2014/12/16/hosting-debian-packages-on-bintray-rocks/, is still good, despite that it is published in year 2014.

I.e., basically, for Uploading and Publishing Debian release pacakge, the following is all it need, provided that you have created the Debian repo and package already:

curl -X PUT -T libmypack_0.0.1_i386.deb -umyuser:<API_KEY> 'https://api.bintray.com/content/myorg/myrepo/mypack/0.0.1/pool/main/m/mypack/libmypack_0.0.1_i386.deb;deb_distribution=mydist;deb_component=main;deb_architecture=i386,amd64;publish=1'

To create the Debian package entry within the given repo, it is as simple as:

curl -v -H "Content-Type: application/json" -u$mybintrayid:$mybintraykey https://api.bintray.com/packages/$mybintrayid/$mybintrayrepo-d '{"name":"libterm-screencolor-perl","desc":"This package...","licenses":["MIT","GPL-3.0"],"vcs_url":"https://github.com/bintray/bintray-examples","public_download_numbers":false}'

To create a Debian repo is also as simple as above, all explained clearly in above blog. And check also the Bintray Debian Repository Creation and Upload file using API for the condensed and practical version.

But I think goreleaser should assume that the repo already exist, and the only jobs need to do is to create the Debian package and then upload it, as explained above.

To change the goreleaser code it seems straightforward as well.

  • duplicate pipeline/fpm/fpm.go as ./pipeline/bintray/bintray.go, as all the package info can all be obtained from the fpm configuration.
  • create a internal/client/bintray.go that does CreateRelease (to create the Debian package), and Upload, both by using the above curl CLI code.

It is the internal piping, code organization, context.Context, releaseID, content, body etc, etc that really confuses me. Moreover, the .goreleaser.yml file needs to have a new entry bintray that accept BintrayUserName as the (only) configurable parameter. That part I have no idea yet. The mybintraykey should be define the same way as the GITHUB_TOKEN is defined, and is recommended to be called BINTRAY_API_KEY.

So I can only describe in high level what should be done, but cannot do it myself.
But you can see that there isn't much to do on the bintray cli side actually, for the magic to happen.

Hope someone can get this done soon.

Thanks

@mattstratton
Copy link
Contributor

@suntong have you gotten this working in travis by any chance? I've tried using the example you gave - I can get it working in my local terminal, but when I attempt it in Travis it has all sorts of problems (it claims it cannot open the .deb file, etc, even though I do an ls in travis and it sees the file in dist just fine).

If you have an example of a working travis setup that would be grand.

@suntong
Copy link

suntong commented Oct 3, 2017

Oh yeah, I had build a simple example after this, which was aimed for people to easily follow -- wireframe:

  • how to use Continuous-Integration travis-ci to build and release binary executables (of all OS platforms) every time you do a git commit
  • how to package the final tool as debian package and upload to your PPA on bintray, so that people can easily install and get your updates

@jorinvo
Copy link
Contributor

jorinvo commented Oct 5, 2017

Just leaving this here for reference: https://github.com/laher/goxc/blob/master/tasks/bintray.go
Guess we can have a look at this since it's basically what we wanna do.

@stale
Copy link

stale bot commented Dec 6, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Dec 6, 2017
@caarlos0 caarlos0 added the pinned label Dec 6, 2017
@stale stale bot removed the wontfix This will not be worked on label Dec 6, 2017
@caarlos0 caarlos0 added feature enhancement New feature or request and removed feature-request labels Mar 6, 2018
@jbaruch
Copy link
Contributor

jbaruch commented Jul 19, 2018

While deb packaging and using deb repositories in Bintray, pushing any type of file to a generic repo also makes a lot of sense. While in an essence it's nothing more than an HTTP PUT, having a native command for it would be nice.

@caarlos0
Copy link
Member Author

caarlos0 commented Jul 19, 2018

Maybe the new http put pipe solves this issue already?

https://goreleaser.com/put/

@jbaruch
Copy link
Contributor

jbaruch commented Jul 20, 2018

Functionally it sure does. The question is do we want to have a nice native command and a DSL around it. I think it makes sense, not every Bintray user realizes how easy it is to upload using HTTP PUT.

@caarlos0
Copy link
Member Author

Maybe we can solve this with documentation only? I don't use bintray, if someone can add some examples on how to publish to bintray using the http put pipe, it would be awesome :D

@jbaruch
Copy link
Contributor

jbaruch commented Jul 20, 2018

That someone would be me :)

@caarlos0
Copy link
Member Author

Cool, thanks @jbaruch :D

@caarlos0
Copy link
Member Author

Hi @jbaruch , do you need my help in this one? What can I do?

Cheers!

@caarlos0 caarlos0 modified the milestones: v2.0.0, v1.0.0 Aug 20, 2018
@caarlos0 caarlos0 added the docs A problem or enhancement in documentation label Aug 20, 2018
@caarlos0 caarlos0 removed the enhancement New feature or request label Aug 20, 2018
@jbaruch
Copy link
Contributor

jbaruch commented Sep 5, 2018

If you can generate 12 more hours a day, that would be it :)

@caarlos0
Copy link
Member Author

caarlos0 commented Sep 5, 2018

i could not :/

if you know anyone that can do that, please let me know haha

@jbaruch
Copy link
Contributor

jbaruch commented Sep 10, 2018

It is half-solved by #791, but won't it be wonderful to have a proper DSL for it.

@caarlos0
Copy link
Member Author

It is half-solved by #791, but won't it be wonderful to have a proper DSL for it.

what do you mean by proper DSL?

@jbaruch
Copy link
Contributor

jbaruch commented Sep 14, 2018

YAML config, like for Artifactory.

@caarlos0
Copy link
Member Author

hmm, we can do it, yes... I don't have exp with bintray... are you interested in taking over this part?

@diafour
Copy link

diafour commented Jan 16, 2019

Release to the Bintray is not just one PUT so dedicated yaml config (DSL) is definitely needed.

Background:

  • First you should create a new version with POST request. Version string can be passed as json payload or with "X-" header. https://bintray.com/docs/api/#_create_version
  • The next step is upload a content with PUT request as stated in Create bintray.md #791. Upload API has publish flag to publish content immediately — works like draft in github configuration.

@caarlos0
Copy link
Member Author

caarlos0 commented Oct 6, 2019

If someone is willing to do this, happy to help, otherwise will auto close in a few days...

this issue is now open for almost 3 years and had no activity for several months...

@stale
Copy link

stale bot commented Oct 20, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added wontfix This will not be worked on and removed wontfix This will not be worked on labels Oct 20, 2019
@stale
Copy link

stale bot commented Nov 3, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Nov 3, 2019
@stale stale bot closed this as completed Nov 10, 2019
@reddec
Copy link
Contributor

reddec commented Dec 30, 2019

I would like to try to implement such feature. Maybe not fully, but a little bit more rich than just PUT.

As an example my projects ws2connect, tinc-boot or storages where I have to use curl to use Bintray features (look into Github Actions tab for a code) as well as Goreleaser.

If maintainers will be not against, I could make the draft implementation within several week (sorry, but I don't have too much free time now), however I would very appreciate for any help from project specialists.

@caarlos0
Copy link
Member Author

hey @reddec, feel free to work on it, let me know if you have any questions :)

@github-actions
Copy link
Contributor

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
docs A problem or enhancement in documentation hacktoberfest wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

9 participants