TL;DR
This blog post details all ways you can push packages to packagecloud using different languages and platforms.
Pushing a Package: Fundamentals
For this example, we’ll use our packagecloud-test package. We’ll be pushing this package to julio/example_repo
for the ubuntu/utopic
distribution.
If you’d like to follow along, make sure you have your API token handy.
The steps for pushing a package are as follows:
-
Skip this step for rubygems Use the distributions API to get the desired
distro_version_id
for your upload. (This is also a great endpoint for testing that your API token and http client are setup correctly) -
Send a
POST
request with thedistro_version_id
to the package create API to push your package.
Using packagecloud.io
Click the Add Package button.
Using curl
Fetch the list of distributions.
We can see that it’s 142
(helps if you pretty print the JSON).
Using package_cloud gem
(It will ask for your API token on first use)
Using packagecloud-ruby gem
Using io.packagecloud.client java library
Using pkgcloud go library
Using Jenkins Packagecloud Plugin
See the plugin documentation for usage and install instructions.
Using Travis CI
See the plugin documentation for usage instructions.
Using anything that can speak HTTP
To construct a package create API request, you need the following:
- A
POST
request of theContent-Type
multipart/form-data
- The body of which needs to be a valid MIME Multipart message with two parts:
package[distro_version_id]
: atext/plain
part containing thedistro_version_id
package[package_file]
: anapplication/octet-stream
part containing the binary data of that package
Conclusion
We are always adding new integrations and ways to push to packagecloud, check back often to see if your favorite language or platform has been added!
Check out our slack or email support@packagecloud.io if you have any suggestions for new languages or platforms to support.