简体   繁体   English

维护文件夹结构jFrog Artifactory Deployer TFS插件

[英]Maintain folder structure jFrog Artifactory Deployer TFS plugin

I'm working on a new CI proof of concept. 我正在研究新的CI概念验证。 I'm using TFS build and attempting to integrate jFrog Artifactory. 我正在使用TFS构建并试图集成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] 我正在尝试在Artifactory存储库中创建一个文件夹结构,如下所示:[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] 我已使用PowerShell在Artifactory登台目录中编写了以下正确结构的脚本:[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. ...,最后将我的[Artifacts Folder]压缩到[Artifacts Folder] .zip存档中,以部署到Artifactory存储库。

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: 现在,尽管jFrog文档指示为此目的在jFrog 1.7中引入了--explode选项,但是尝试使用此选项进行上载会返回“使用不正确”错误:

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运行'C:\\ jfrog \\ jfrog.exe'rt上载'[Artifactory Staging Directory] ​​\\ [Artifacts Folder] \\ *''[repository] ​​/ [sub-repository] ​​/ [Artifacts文件夹]'-- 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: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 2018-10-01T10:21:29.6761967Z

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

2018-10-01T10:21:29.6761967Z jfrog rt upload - Upload files 2018-10-01T10:21:29.6761967Z jfrog rt上传-上传文件

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

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

2018-10-01T10:21:29.6761967Z jfrog rt upload [command options] [arguments...] 2018-10-01T10:21:29.6761967Z jfrog rt上传[命令选项] [参数...]

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

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

2018-10-01T10:21:29.6761967Z --url [Optional] Artifactory URL 2018-10-01T10:21:29.6761967Z --url [可选]人工URL

2018-10-01T10:21:29.6761967Z --user [Optional] Artifactory username 2018-10-01T10:21:29.6761967Z --user [可选] Artifactory用户名

2018-10-01T10:21:29.6761967Z --password [Optional] Artifactory password 2018-10-01T10:21:29.6761967Z --password [可选]人工密码

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

2018-10-01T10:21:29.6761967Z --ssh-key-path [Optional] SSH key file path 2018-10-01T10:21:29.6761967Z --ssh-key-path [可选] SSH密钥文件路径

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 --props [可选]形式为“ key1 = value1; key2 = value2,...”的属性列表,将附加到上载的工件上。

2018-10-01T10:21:29.6761967Z --deb [Optional] Used for Debian packages in the form of distribution/component/architecture. 2018-10-01T10:21:29.6761967Z --deb [可选]以分发/组件/架构的形式用于Debian软件包。

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 --recursive [Default:true]如果您不希望在子文件夹中收集工件以上传到Artifactory,则设置为false。

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 --flat [Default:true]如果设置为false,则根据文件系统层次结构上载文件。

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 --regexp [Default:false]设置为true以使用正则表达式而不是通配符表达式来收集要上传的文件。

2018-10-01T10:21:29.6917936Z --threads [Default: 3] Number of artifacts to upload in parallel. 2018-10-01T10:21:29.6917936Z --threads [默认值:3]要并行上传的工件数量。

2018-10-01T10:21:29.6917936Z --dry-run [Default: false] Set to true to disable communication with Artifactory. 2018-10-01T10:21:29.6917936Z --dry-run [默认值:false]设置为true以禁用与Artifactory的通信。

2018-10-01T10:21:29.6917936Z 2018-10-01T10:21:29.6917936Z

I using jFrog Artifactory Deployer 2.1.1 TFS build task. 我使用jFrog Artifactory Deployer 2.1.1 TFS构建任务。

This command line option is described here: https://www.jfrog.com/confluence/display/CLI/CLI+for+JFrog+Artifactory#CLIforJFrogArtifactory-UploadingFiles 此处描述了此命令行选项: 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. 但是,似乎我们的TFS服务器上的jFrog.exe无法理解--explode命令行选项。

(Note: I am unsure what version of jFrog.exe is running on our build servers; currently awaiting details from responsible team, update to follow.) (注意:我不确定我们的构建服务器上正在运行什么版本的jFrog.exe;当前正在等待负责团队的详细信息,请进行更新。)

Is the issue that the jFrog.exe version is older (pre 1.7) and does not support the --explode command option? 是jFrog.exe版本是否较旧(1.7之前的版本)并且不支持--explode命令选项的问题? 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). (注意:我应用了--flat = false选项,但暂存文件夹层次结构已保留回到根目录;这也不是必需的)。

insights appreciated, thanks for looking.. 感谢您的见解,感谢您的关注。

In the end, we were able to work around the absence of the '--explode' command option by using placeholders like so: 最后,我们可以使用如下所示的占位符来解决缺少'--explode'命令选项的问题:

In the jFrog Artifactory Deployer task: 在jFrog Artifactory Deployer任务中:

Path to the Artifacts: [Artifacts Folder]\\(**)\\(*) 工件路径:[工件文件夹] \\(**)\\(*)

Target Repository [repository]/[sub-repository]/[Artifacts Folder]/{1}/ 目标存储库[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. 以这种方式使用占位符可以根据需要将文件夹结构保留在推送到Artifactory存储库中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM