简体   繁体   English

如何在Jenkins中使用filespec动态创建文件夹并在Jfrog人工制品中上传人工制品?

[英]How to create folders dynamically and upload artifacts in Jfrog artifactory using filespecs in Jenkins?

I have a build job in jenkins which builds the project from github for any branch. 我在jenkins中有一个构建工作,它可以从github为任何分支构建项目。 package will be created in build job workspace with the version as xxxx-yyyyy-2.15.0-SNAPSHOT.zip . 软件包将在构建作业工作区中以xxxx-yyyyy-2.15.0-SNAPSHOT.zip的版本xxxx-yyyyy-2.15.0-SNAPSHOT.zip

My next artifactory push job has filespec written as below: 我的下一个工件推送工作的文件规格如下:

{ 
 "files": [
       {
           "pattern": "/var/lib/jenkins/workspace/Jobname/target/*/xxxx-yyyyy*.zip",
           "target": "libs-snapshot-local/xxxx-yyyyy/",
           "recursive": "false"
       }
    ]
}

Above filespec recognize the pattern and upload the zip in libs-snapshot-local/xxxx-yyyyy/ . 上面的文件规范识别出该模式,并将zip文件上传到libs-snapshot-local/xxxx-yyyyy/ But I need to upload the file with folder created with version name available on the zip file xxxx-yyyyy-2.15.0-SNAPSHOT.zip . 但是我需要上传文件,并使用在zip文件xxxx-yyyyy-2.15.0-SNAPSHOT.zip可用的版本名称创建的文件夹。

Can anybody help me to create a folder dynamically with version name? 有人可以帮我动态创建一个带有版本名称的文件夹吗? any idea on how to specify target path in filespec? 关于如何在filespec中指定目标路径的任何想法?

The file specs has the ability to use placeholders in order to create more flexible paths. 文件规范可以使用占位符来创建更灵活的路径。
For example in your case: 例如,在您的情况下:

{ 
 "files": [
       {
           "pattern": "/var/lib/jenkins/workspace/Jobname/target/*/(xxxx-yyyyy*).zip",
           "target": "libs-snapshot-local/{1}/",
           "recursive": "false"
       }
    ]
}

Please pay attention for the parentheses in the pattern and the placeholder marker {1} used in the target. 请注意模式中的括号和目标中使用的占位符标记{1}。

暂无
暂无

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

相关问题 如何使用Filespec捆绑JFrog Artifactory中的工件? - How Do I Bundle Artifacts in JFrog Artifactory Using Filespecs? 如何使用Jenkins中的URL触发器插件返回添加到Jfrog工件中的新工件的确切名称 - How to return the exact names of the new artifacts added to Jfrog artifactory using URL Trigger plugin in Jenkins 如何使用jenkins发布构建动作将工件从工件组部署到jfrog工件 - How to deploy an artifact from group of artifacts to jfrog artifactory using jenkins post build action 在jenkins管道中将通用工件上传到JFrog Artifactory时,如何重命名现有文件夹 - How to rename existing folder while uploading generic artifacts to JFrog Artifactory in jenkins pipeline 如何通过Jenkins Build Offline将工件部署到Maven存储库(JFrog工件)? - How to deploy artifacts to Maven Repository (JFrog artifactory) through Jenkins Build Offline? 从Jenkins将多个Gradle工件上传到Artifactory - Upload multiple Gradle artifacts to Artifactory from Jenkins 如何在Windows机器上从Jfrog Artifactory下载最新的工件 - How to download the latest Artifacts from Jfrog Artifactory on a Windows Machine JFrog Artifactory 通过 Jenkins 上传 tar 失败,出现 404 - JFrog Artifactory upload tar via Jenkins failes with 404 Jfrog神器与jenkins集成 - Jfrog artifactory intigration with jenkins 使用声明式管道将项目 Jar 作为 maven 工件发布到 Jfrog Artifactory - Publish project Jar as maven artifacts to Jfrog Artifactory using Declarative Pipeline
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM