Jenkins 和 JFrog Artifactory - 在 "maxBuilds" 之后不会删除工件
Jenkins and JFrog Artifactory - artifacts are not deleted after "maxBuilds"
我正在使用 JFrong 插件成功上传我的作品。
我想我已经设置了一旦构建(工件)数量超过 5 个就自动删除的所有内容。但是我的工件没有被删除(我有超过 maxBuilds
属性)。在目标存储库和文件夹中,我可以看到比 maxBuilds 数量更多的工件。我的用户确实有权删除工件(我已经手动尝试过)。
我是否正确配置了所有内容?谢谢
stage ('Artifactory stage') {
steps {
rtServer (
id: 'Artifactory',
url: 'https://artifactory.domain/artifactory',
credentialsId: 'test',
timeout: 300
)
}
}
stage ('Build info stage ') {
steps {
rtBuildInfo (
maxBuilds: 5,
deleteBuildArtifacts: true
)
}
}
stage ('Upload stage') {
steps {
rtUpload (
serverId: 'Artifactory',
spec: '''{
"files": [
{
"pattern": "arena-*.zip",
"target": "project/packages/"
}
]
}''',
)
}
}
stage ('Publish build info') {
steps {
rtPublishBuildInfo (
serverId: 'Artifactory'
)
}
}
构建结束时的日志信息...
[Pipeline] stage [Pipeline] { (Build info stage ) [Pipeline] rtBuildInfo [Pipeline] } [Pipeline] // stage [Pipeline] stage [Pipeline] { (Upload stage) [ Pipeline] rtUpload [consumer_0] 部署工件:https://artifactory.domain/artifactory/packages/arena-2022-02-07-11-31-58.zip } [Pipeline] // stage [Pipeline] stage [Pipeline] { (Publish build info) [Pipeline] rtPublishBuildInfo Deploying build info to: https://artifactory.domain/artifactory/api/build Deploying build descriptor to: https://artifactory.domain/artifactory/api/build Build successfully deployed. Browse it in Artifactory under https://artifactory.domain/artifactory/webapp/builds/UUEAW%20::%20ArenaWebRuf%20::%20master/81 发送构建保留请求,删除构建工件,要存储的最大构建数:5. [Pipeline] } [Pipeline] // stage [Pipeline]阶段 [管道] {(声明:Post 操作)
将captureEnv: true
添加到rtBuildInfo
闭包:
rtBuildInfo (
captureEnv: true
maxBuilds: 5,
deleteBuildArtifacts: true
)
Capturing Environment Variables
To set the Build-Info object to
automatically capture environment variables while downloading and
uploading files, add the following to your script.
By default, environment variables names which include "password",
"psw", "secret", "token", or "key" (case insensitive) are excluded and
will not be published to Artifactory.
我正在使用 JFrong 插件成功上传我的作品。
我想我已经设置了一旦构建(工件)数量超过 5 个就自动删除的所有内容。但是我的工件没有被删除(我有超过 maxBuilds
属性)。在目标存储库和文件夹中,我可以看到比 maxBuilds 数量更多的工件。我的用户确实有权删除工件(我已经手动尝试过)。
我是否正确配置了所有内容?谢谢
stage ('Artifactory stage') {
steps {
rtServer (
id: 'Artifactory',
url: 'https://artifactory.domain/artifactory',
credentialsId: 'test',
timeout: 300
)
}
}
stage ('Build info stage ') {
steps {
rtBuildInfo (
maxBuilds: 5,
deleteBuildArtifacts: true
)
}
}
stage ('Upload stage') {
steps {
rtUpload (
serverId: 'Artifactory',
spec: '''{
"files": [
{
"pattern": "arena-*.zip",
"target": "project/packages/"
}
]
}''',
)
}
}
stage ('Publish build info') {
steps {
rtPublishBuildInfo (
serverId: 'Artifactory'
)
}
}
构建结束时的日志信息...
[Pipeline] stage [Pipeline] { (Build info stage ) [Pipeline] rtBuildInfo [Pipeline] } [Pipeline] // stage [Pipeline] stage [Pipeline] { (Upload stage) [ Pipeline] rtUpload [consumer_0] 部署工件:https://artifactory.domain/artifactory/packages/arena-2022-02-07-11-31-58.zip } [Pipeline] // stage [Pipeline] stage [Pipeline] { (Publish build info) [Pipeline] rtPublishBuildInfo Deploying build info to: https://artifactory.domain/artifactory/api/build Deploying build descriptor to: https://artifactory.domain/artifactory/api/build Build successfully deployed. Browse it in Artifactory under https://artifactory.domain/artifactory/webapp/builds/UUEAW%20::%20ArenaWebRuf%20::%20master/81 发送构建保留请求,删除构建工件,要存储的最大构建数:5. [Pipeline] } [Pipeline] // stage [Pipeline]阶段 [管道] {(声明:Post 操作)
将captureEnv: true
添加到rtBuildInfo
闭包:
rtBuildInfo (
captureEnv: true
maxBuilds: 5,
deleteBuildArtifacts: true
)
Capturing Environment Variables
To set the Build-Info object to automatically capture environment variables while downloading and uploading files, add the following to your script.
By default, environment variables names which include "password", "psw", "secret", "token", or "key" (case insensitive) are excluded and will not be published to Artifactory.