Cross-Platform OS Packaging and Publishing to Bintray using Travis & Appveyor #86
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Introduction
This pull request is in response to #70 . It contains a LOT of new information, and it will take time and emails or slack chats to digest it all. If you want to create a separate branch for this, I'm happy to resubmit.
Packaging
Cross-platform OS packaging with full support for the built-in OS package managers is inherently complicated. Fortunately, one OSS developer went to great lengths to bring it within reach of mortals. His Github handle is
mh-cbon
, and he created all the tools used for this process.At a high level, he defined a fairly standardized JSON schema for each of the three most popular (and wildly different) OS package managers. He then applied a standardized CLI experience and created corresponding package utilities:
go-msi
,go-bin-deb
, andgo-bin-rpm
. The tools read the configs, translate them to the proprietary formats, and then automates the calls to the proprietary package tools behind the scenes. It's a remarkable achievement. The best primer is to read about the tools and process detailed here (although our strategy diverges in a few areas):My contribution was to streamline the use of his tools into effective "recipe templates" for publishing his packaging tools to Bintray rather than gh-pages and gh-release. This led me to finding and using
jfrog-go-cli
for the publishing. I then discovered thatjfrog-cli-go
could benefit from the same workflow, so I ported the templates to here. It was actually "easy" to port the recipe's from the other repos, which is a testament to the modularity and portability of the strategy. However, please note, it took actual work weeks to figure the whole strategy out, so "grokking" it all will not be trivial to learn (but at least now it's approachable).Outputs
To see the finished products of the additions made in this PR, you can look at these repositories:
You can intall the CLI from any of these repos using the corresponding package managers.
First you add the repo to your local list:
Debian
echo "deb https://dl.bintray.com/bincrafters/public-deb unstable main" | sudo tee -a /etc/apt/sources.list && sudo apt-get update
Redhat/Centos/Fedora
wget https://bintray.com/bincrafters/public-rpm/rpm -O bintray-bincrafters-public-rpm.repo && sudo mv bintray-bincrafters-public-rpm.repo /etc/yum.repos.d/ && sudo yum update
Windows
choco source add -n=bincrafters -s="https://api.bintray.com/nuget/bincrafters/public-choco"
Then install:
Debian
apt-get install jfrog-cli-go
Redhat/Centos/Fedora
yum install jfrog-cli-go
Windows
choco install jfrog-cli-go
Moving Forward
In theory, JFrog should have (or create) a similar set of public repos for developers to release official JFrog software through (such as jfrog-cli-go). It's kind of madness not to drink your own kool-aid in this case. So, one reasonable approach to "take over" the recipe's here is to create your own repos and CI accounts, and change all the relevant variables. You could also try to migrate them to Jenkins and go a different appraoch. I'm happy to help either way.
Also, you may choose to publish jfrog-cli-go to Chocolatey. I certainly encourage it, and it's very easy once you've published to your own nuget repository once. You may also want to submit to "apt" and "yum" central repositories, I have never done this, but would be interested in seeing how it goes. I hear it's much more involved than Chocolatey.
Outstanding "Nuances"
-- Thus, after the first successful build/publish of .NUGET to bintray, subsequent builds will fail
-- I have opened two tickets for this, one to change JFrog CLI behavior , one to fix the web API
-- This doesn't fit well with Appveyor Matrix, which wants to build each separately
-- You may want to modify the build step to compile both in one build, and then package both.
-- Currently, appveyor creates both MSI, but only creates i386 NUGET package for chocolatey.
Good luck, and feel free to reach out to me via email for extended discussion.