How_Can我在Artifactory中制作版本

时间:2022-08-16 22:48:18

While running a job in jenkins using ant script i got the build in artifactory . My problem is when a change in build happens it should store as a new version in artifactory. How can i do this?

在使用ant脚本在jenkins中运行一个工作时,我得到了神器的构建。我的问题是当构建发生变化时,它应该作为神器中的新版本存储。我怎样才能做到这一点?

Thank You

谢谢

1 个解决方案

#1


1  

The question is missing a lot of details, but assuming you are using a Jenkinsfile together with the Artifactory Jenkins plugin, you would need to use something like ${env.BUILD_NUMBER} when defining the target in the Jenkinsfile.

问题是缺少很多细节,但假设您正在使用Jenkinsfile和Artifactory Jenkins插件,在Jenkins文件中定义目标时需要使用$ {env.BUILD_NUMBER}之类的东西。

It should be something similar to:

它应该类似于:

{
  "files": [
    {
      "pattern": "my-build-directory/*.tar.gz",
      "target": "my-repo/${env.BUILD_NUMBER}/"
    }
  ]
}

If this helps answer your question, I would appreciate it if you could mark it as the accepted answer.

如果这有助于回答您的问题,如果您能将其标记为已接受的答案,我将不胜感激。

#1


1  

The question is missing a lot of details, but assuming you are using a Jenkinsfile together with the Artifactory Jenkins plugin, you would need to use something like ${env.BUILD_NUMBER} when defining the target in the Jenkinsfile.

问题是缺少很多细节,但假设您正在使用Jenkinsfile和Artifactory Jenkins插件,在Jenkins文件中定义目标时需要使用$ {env.BUILD_NUMBER}之类的东西。

It should be something similar to:

它应该类似于:

{
  "files": [
    {
      "pattern": "my-build-directory/*.tar.gz",
      "target": "my-repo/${env.BUILD_NUMBER}/"
    }
  ]
}

If this helps answer your question, I would appreciate it if you could mark it as the accepted answer.

如果这有助于回答您的问题,如果您能将其标记为已接受的答案,我将不胜感激。