oTolev
oTolev

Reputation: 241

suggested workflow for artifactory and jenkins

I'm new to artifactory, have some basic question. Unfortunately did not find best practices/suggested workflows in the jfrog docs.. As far as I understand there are 2 basic flows for generic build to work with Jenkins:

  1. Create tar and with naming convention that holds the build number in it's name (for example my-build-dev-128.tar.gz) and a file ( last-build.txt) that will hold the last build string. So when Jenkins/user needs to download the latest build I download the last-build.txt and get the build number from the string, then download the last artifact.
  2. Add server.publishBuildInfo buildInfo to the artifactory upload and then each file has it's own build and that way when you download it has build properties you can work with - however I was not able to pull specific build (have to specify the files that I need and it's always downloading the last build of the file) .

So, what is the best workflow practice for Jenkins/Artifactory marriage ( push , pull, get latest and get older artifacts in automatic way (cli/API/Jenkins plugin - but not GUI)?

Upvotes: 0

Views: 222

Answers (1)

Prostagma
Prostagma

Reputation: 1851

Best practice is to publish a build info like you mentioned. The build doesn't have to be for a single file, it can include multiple ones. See these examples for declarative or scripted workflows.

When you download, the download command accepts a file spec. In the build field of the file spec you can specify a build name without a build number which will download the artifacts of the latest build. When you specify a build, the aql and pattern fields are optional. You can still use them if you'd like to filter some of the build artifacts.

An additional file to hold the build details is redundant, this is what the build info is for.

Upvotes: 0

Related Questions