0
votes

I'm working on a new CI proof of concept. I'm using TFS build and attempting to integrate jFrog Artifactory.

I'm trying to create a folder structure within my Artifactory repository like so: [repository]/[sub-repository]/[Artifacts Folder]/[Versioned Artifact Folder]/[Versioned Artifact Zip Archive]

I've scripted the creation of the following correct structure in my Artifactory staging directory with PowerShell: [Artifacts Folder]\[Versioned Artifact Folder]\[Versioned Artifact Zip Archive]

... and finally compressed my [Artifacts Folder] into a [Artifacts Folder].zip archive for deployment to Artifactory repository.

Now, although jFrog documentation indicates the introduction of an --explode option in jFrog 1.7 for this purpose, attempts to upload using this option returned an Incorrect Usage error:

2018-10-01T10:21:28.3168258Z running 'C:\jfrog\jfrog.exe' rt upload '[Artifactory Staging Directory]\[Artifacts Folder]\*' '[repository]/[sub-repository]/[Artifacts Folder]' --url=https://www.artifactrepository.xxx.net/artifactory --explode=true --user=******** --password=******** --props='build.number=[build_number];build.name=[build_name]'

2018-10-01T10:21:28.3168258Z

2018-10-01T10:21:28.3168258Z

2018-10-01T10:21:29.6761967Z Incorrect Usage.

2018-10-01T10:21:29.6761967Z

2018-10-01T10:21:29.6761967Z NAME:

2018-10-01T10:21:29.6761967Z jfrog rt upload - Upload files

2018-10-01T10:21:29.6761967Z

2018-10-01T10:21:29.6761967Z USAGE:

2018-10-01T10:21:29.6761967Z jfrog rt upload [command options] [arguments...]

2018-10-01T10:21:29.6761967Z

2018-10-01T10:21:29.6761967Z OPTIONS:

2018-10-01T10:21:29.6761967Z --url [Optional] Artifactory URL

2018-10-01T10:21:29.6761967Z --user [Optional] Artifactory username

2018-10-01T10:21:29.6761967Z --password [Optional] Artifactory password

2018-10-01T10:21:29.6761967Z --apikey [Optional] Artifactory API key

2018-10-01T10:21:29.6761967Z --ssh-key-path [Optional] SSH key file path

2018-10-01T10:21:29.6761967Z --props [Optional] List of properties in the form of "key1=value1;key2=value2,..." to be attached to the uploaded artifacts.

2018-10-01T10:21:29.6761967Z --deb [Optional] Used for Debian packages in the form of distribution/component/architecture.

2018-10-01T10:21:29.6917936Z --recursive [Default: true] Set to false if you do not wish to collect artifacts in sub-folders to be uploaded to Artifactory.

2018-10-01T10:21:29.6917936Z --flat [Default: true] If set to false, files are uploaded according to their file system hierarchy.

2018-10-01T10:21:29.6917936Z --regexp [Default: false] Set to true to use a regular expression instead of wildcards expression to collect files to upload.

2018-10-01T10:21:29.6917936Z --threads [Default: 3] Number of artifacts to upload in parallel.

2018-10-01T10:21:29.6917936Z --dry-run [Default: false] Set to true to disable communication with Artifactory.

2018-10-01T10:21:29.6917936Z

I using jFrog Artifactory Deployer 2.1.1 TFS build task.

This command line option is described here: https://www.jfrog.com/confluence/display/CLI/CLI+for+JFrog+Artifactory#CLIforJFrogArtifactory-UploadingFiles

However, it seems that jFrog.exe which is on our TFS servers doesn’t understand --explode command line option.

(Note: I am unsure what version of jFrog.exe is running on our build servers; currently awaiting details from responsible team, update to follow.)

Is the issue that the jFrog.exe version is older (pre 1.7) and does not support the --explode command option? If so, is there an alternative way to achieve multiple artifact upload while preserving staging folder structure?

(Note: I applied the --flat=false option but the staging folder hierarchy was preserved right back to the root; this is not what's required either).

insights appreciated, thanks for looking..

1

1 Answers

1
votes

In the end, we were able to work around the absence of the '--explode' command option by using placeholders like so:

In the jFrog Artifactory Deployer task:

Path to the Artifacts: [Artifacts Folder]\(**)\(*)

Target Repository [repository]/[sub-repository]/[Artifacts Folder]/{1}/

The use of placeholders in this way accomplished the preservation of folder structure in the push to the Artifactory repository as required.