How to trigger Artifactory build retention from gradle

user2738748

Is it possible to set build retention on Artifactory using gradle using the netflix nebula plugins?

I've searched the Internet and all I've been able to find is how to set build retention using Jenkins pipeline: buildInfo.retention maxBuilds: 10.

I've also found how to set build name and build number on Gradle Artifactory Plugin page:

clientConfig.info.setBuildName('new-strange-name')
clientConfig.info.setBuildNumber('1111')

However, I haven't found any information on how to specify build retention from gradle. I could use something like this:

clientConfig.info.setRetention(maxBuilds: 10, maxDays: 7)

Is it possible? If not, how can I achieve the same goal? Should I update the buildinfo of my build using the Jenkins pipeline plugin after the build was created and set the build retention there?

M.Ricciuti

Using the Gradle Artifactory Plugin, you can use the artifactory extension to configure BuildInfo properties. From this extension you can access the BuildInfoHandler properties, like buildRetentionDays or buildRetentionMinimumDate as follows:

artifactory {
    // publish & contextUrl  configuration
    // (...)

    clientConfig.info.setBuildName('custom-build-name')
    clientConfig.info.buildRetention.count = 10
    // see other configurable properties here :
    // https://github.com/jfrog/build-info/blob/branch-gradle2/build-info-client/src/main/java/org/jfrog/build/client/ArtifactoryClientConfiguration.java
}

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to implement build specific annotation retention in Java

IntelliJ / Gradle - composite build project - how to import from different module?

How to script Gradle in order to publish shadowjar into Artifactory

Kotlin Gradle build with Spring Boot not publishing jars to Artifactory - only build info

How to execute git command from build.gradle?

How to move a gradle function from build.gradle into a plugin?

Accessing Dependency from Artifactory using Gradle

How to trigger a Jenkins build on a new artifact in Artifactory?

Gradle with artifactory

Gradle Artifactory Plugin - How to publish artifacts from multiple modules in a project?

How to apply build trigger for bitbucket in jenkins from groovy sccript?

how to execute 'gradle build' command from gradle.build script

Why is Artifactory returning a 403 for all users when called from gradle artifactory plugin?

Gatsby Webhooks and how to trigger the build from Strapi

How to fix build gradle

How to build a gradle jar from a github library

How to include projects in multiproject build from master directory in Gradle?

how to trigger a CI build from TFS2012 to Hudson?

build.gradle how to apply a closure from another file

How to use gradle Artifactory plugin in gradle subproject

How to checkout and build maven project from gradle?

How to call build.gradle from another build.gradle

How to determine debug build from gradle?

How to deploy an artifact from group of artifacts to jfrog artifactory using jenkins post build action

How to use Artifactory Maven Build in Jenkins Pipeline

How do I publish Gradle plugins to Artifactory?

How Do I Set The Username/Password For The Build Info Using The Artifactory Gradle Plugin?

How to build a jar file on Azure and copy to Artifactory?

How to execute "./gradlew build --refresh-dependencies" from gradle plugin