openhab / openhab-linuxpkg

Repo for Linux packages
Eclipse Public License 2.0
18 stars 33 forks source link

Build Release/Testing Distribution Task #88

Closed BClark09 closed 6 years ago

BClark09 commented 6 years ago

Previously, I have been setting up stable releases and testing releases manually using the web UI. The jfrog REST api allows us to deploy artifacts to Bintray:

I've now setup the distribution repo to sort .rpm and .deb files, and automatically calculate the path to place in Bintray, all we need to do is select the file place it "in" the distribution repo.

To do that we must:

Example:

task deployToBintray(type:Exec) {
  def distributeRepo = 'openhab-linuxpkg-distribution'
  def distributeURL = ''https://openhab.jfrog.io/${ARTIFACTORY_ORG}/api/distribute"
  def packagePath = "openhab-linuxpkg/pool/main/2.1.0/openhab2_2.1.0-1_all.deb"

  executable "curl"
  args '-X', 'POST', '-H', "X-JFrog-Art-Api: ${ARTIFACTORY_KEY}", '-H', 'Content-Type: application/json', '-d', "{\"targetRepo\" : \"${distributeRepo}\", \"packagesRepoPaths\" : [\"${packagePath}\"]}, "${distributeURL}"
}