문제

I'm developing my own hudson plugin and can not find a really comprehensive documentation.

How can I connect to the artifactory plugin to get a list of artifacts? The artifactory plugin is installed in hudson but I don't know how to instance it/connect to it from my own plugin.

My plugin deploys a specific version to our webstart server. This includes downloading the artifact from artifactory over HTTP, creating version.xml and *.jnlp file and uploading these three files to the webserver using SCP. For the configuration of this plugin, I need a list of all versions of a specific project from artifactory.

Thanks in advance.

도움이 되었습니까?

해결책

If you'd like to use model and utility classes of another plugin, then it's simply a process of depending on that plugin (compile-wise) and making sure that the dependent plugin is installed so you can reference these classes at runtime.

If you'd like to use entities like builders, actions or wrappers, you'll probably need to use Hudson's facilities; I'm not so sure as to which facilities it has, but Jenkins' hudson.model.AbstractBuild and hudson.model.AbstractProject (and other) objects have methods like:

  • hudson.model.Actionable#getActions
  • AbstractProject#getPublishersList

That'll return those entities (assuming they're configured on the project in question).

Apart from that approach, there are a number of ways to solve your issue using Artifactory's REST API:

  • If the artifacts are contained in Artifactory within one location that's known to you, you can execute a file list query to reveal the contents of that directory.

  • If you'd like to fetch the produced artifacts of a specific Hudson build, and assuming that you use the Hudson plugin to deploy Build Info, you can request the Build Info object using the Build Info resource; utilizing the checksums of the produced artifacts listed in this object, you can perform artifact checksum queries to find out if and where these artifacts exist in Artifactory.

  • If you don't know the specific build name and number or the location, you can use any of the search facilities to locate artifacts based on different details; The GAVC or XPath searchers are most likely to help in your situation.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top