2

How to deploy a Debian package from a Jenkins to the Artifactory Debian repo?
I used a command in the Jenkins Freestyle job:

curl -uUSER:PASS -XPUT "https://ARTIFACTORY_URL/REPO/pool/package.deb;deb.distribution=xenial;deb.component=main;deb.architecture=amd64" -T ./package.deb

but in that case no reference is created between the Artifactory to the Jenkins. Meaning, we cannot link between the Jenkins build to the Artifact.
Next, we tried to use a pipeline and call it from the Freestyle after a Debian package is created. But again, there is no wiki/support about a Debian packages uploading using a DSL.
And seems that the FileSpec doesn't support Debian packages.

How to pass architecture/distribution/component?

Did anyone have an experience with deploying Debian packages to the Artifactory? Sounds easy but still, I'm missing something.

Dima Kreisserman
  • 663
  • 1
  • 13
  • 33

2 Answers2

8

To upload debian packages to artifactory, you can use a fileSpec in your pipeline like that:

{
  "files": [
    {
      "pattern": "YOUR_ARTIFACT_PATH",
      "target": "https://ARTIFACTORY_URL/REPO/pool/",
      "props": "deb.distribution=xenial;deb.component=main;deb.architecture=amd64"
    }
  ]
}
  • do you know how to add gpg signing to the Release file within the Debian Artifactory repo? – Dima Kreisserman Jun 25 '18 at 11:22
  • You can follow [GPG Signing](https://www.jfrog.com/confluence/display/RTF/GPG+Signing) and recalculate indexes. Everytimes a package is pushed on the repository, he will be signed. – RealNeptune Jun 25 '18 at 12:08
4

You can do it simply with jfrog-cli:

jfrog rt u --deb=<distribution>/<component>/<architecture> <debian-package> <debian-repo>/pool/<component>/<first-latter-of-package-name>/<package-name>/<debian-package>

For example: uploading cassandra

jfrog rt u --deb=bionic/main/all cassandra_1.2.3_all.deb debian-local/pool/main/c/cassandra/cassandra_1.2.3_all.deb

Yakir GIladi Edry
  • 2,511
  • 2
  • 17
  • 16