0
votes

I want to publish the artifact from my jenkins instance to artifactory but I just want to publish the mercurial url and the revision as a metadata in the artifactory.

I am not sure how we can achieve this from jenkins instance. I am creating the build through jenkins instance with gradle script so I am using gradle-artifactory plugin to publish it to the artifactory so there is an option deployment properties but I don't know how could I use it.?

Can someone let me know?

1

1 Answers

0
votes

I don't know if you have already used the below jenkins plugin:

Regarding the gradle artifactory plugin, see the below example (https://www.jfrog.com/confluence/display/RTF/Gradle+Artifactory+Plugin):

  // Redefine basic properties of the build info object
  clientConfig.setIncludeEnvVars(true)
  clientConfig.info.addEnvironmentProperty('MERCURIAL_URL', "WHATEVER")
  clientConfig.info.setBuildName('new-strange-name')
  clientConfig.info.setBuildNumber('' + new java.util.Random(System.currentTimeMillis()).nextInt(20000))
}

If that mercurial url is based on Jenkins you can read it easily from gradle via the below command:

System.getenv("HG_URL")

Cheers