GoCD Generic Artifactory Registry Poller
A GoCD plugin that polls a Artifactory repository
The behaviour and capabilities of the plugin are determined to a significant extent by that of the package material extension point in GoCD. Be sure to read the package material documentation before using this plugin.
This plugin polls artifactory repositories using its REST API. It relies on the convention that version number is part of the file path.
Artifactory repository URL must be a valid http or https URL. For example, specify the URL as http://artifactory.example.com/artifactory/. The plugin will try to access the URL to report successful connection.
Click check package to make sure the plugin understands what you are looking for. Note that the version constraints are AND-ed if both are specified.
Published Environment Variables
The following information is made available as environment variables for tasks:
GO_PACKAGE_<REPO-NAME>_<PACKAGE-NAME>_LABEL GO_REPO_<REPO-NAME>_<PACKAGE-NAME>_REPO_URL GO_PACKAGE_<REPO-NAME>_<PACKAGE-NAME>_REPO_ID GO_PACKAGE_<REPO-NAME>_<PACKAGE-NAME>_PACKAGE_PATH GO_PACKAGE_<REPO-NAME>_<PACKAGE-NAME>_PACKAGE_ID GO_PACKAGE_<REPO-NAME>_<PACKAGE-NAME>_LOCATION GO_PACKAGE_<REPO-NAME>_<PACKAGE-NAME>_VERSION
The LOCATION variable points to a downloadable url.
Downloading the Package
To download the package locally on the agent you could use curl (or wget) task like this:
<exec command="cmd" > <arg>/c</arg> <arg>curl -o /path/to/package.zip $GO_PACKAGE_REPONAME_PKGNAME_LOCATION</arg> </exec>
When the task executes on the agent, the environment variables get subsituted and the package gets downloaded.