Go CD generic poller for Artifactory repositories
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
doc
sdk
src/net/varchev/go/plugin/genericArtifactory
test/fast
.gitignore Initial commit Sep 3, 2014
.travis.yml
LICENSE
README.md
build.xml
go-generic-artifactory-poller.iml
go-generic-artifactory-poller.ipr
ivy.xml
plugin.xml

README.md

GoCD Generic Artifactory Registry Poller

A GoCD plugin that polls a Artifactory repository

Build Status

Introduction

This is a package material plugin for GoCD. It is currently capable of polling Artifactory repositories.

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.

Installation

Just drop go-generic-artifactory-poller.jar into plugins/external directory and restart GoCD. More details here

Repository definition

Add an Artifactory repository

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.

Package definition

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.

Define a package as material for a pipeline

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.