[英]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.