Plugin Execution Points

JFrog Integrations Documentation

Content Type
Integrations
ft:sourceType
Paligo

The following table summarizes the available execution points. For more details about specific plugin look follow the section links.

Plugin Type

Code block name

When executed

Description

Upload

Event Callback (without return value)

beforeUploadRequest

On any download

Handle before upload request events, executed before Artifactory starts to handle the original client request, useful for overriding the actual repo path during the Artifactory upload process.

Download

Event Callback (with return values)

altResponse

On any download

Provide an alternative response, by setting a success/error status code value and an optional error message or by setting new values for the inputStream and size context variables (For succeeded resolutions).

altAllResponses

On any download

Provide an alternative response, by setting response headers, a success/error status code value and an optional error message or by setting new values for the inputStream and size context variables. This applies for GET/HEAD requests, for successful resolutions or Not Modified responses.

altRemotePath

When reaching out to remote repositories

Provides an alternative download path under the same remote repository, by setting a new value to the path variable.

altRemoteContent

After fetching content from remote repositories

Provide an alternative download content, by setting new values for the inputStream and size context variables.

afterDownloadError

After failing during content fetching from remote repositories

Provide an alternative response, by setting a success/error status code value and an optional error message or by setting new values for the inputStream and size context variables (For failed resolutions).

Event Callback (without return value)

beforeRemoteDownload

Before fetching content from remote repositories

Handle before remote download events.

afterRemoteDownload 

After fetching content from remote repositories

Handle after remote download events.

beforeDownload

On any download

Handle before download events.

afterDownload

On any download

Handle after download events. It is triggered after download execution, not download completion.

beforeDownloadRequest

On any download

Handle before download request events, executed before Artifactory starts to handle the original client request, useful for intercepting expirable resources (other than the default ones like maven-metadata.xml).

Limitation

The repository ID of the actual repository from which the artifact was requested in the callback is unknown in the case of virtual repositories. Therefore, this The callback method does not work with the Docker Virtual repository.

Storage

Event Callback (without return value)

before/after
Create, Delete, Move, Copy,
PropertyCreate, PropertyDelete

Before / After selected storage operation

Handle events before and after Create, Delete, Move and Copy operations

Note

Artifactory works with transactions. During a transaction, the change may not yet committed to the database. Hence, the previous information may still exist in your database and you may see the outdated information show up after execution in rare cases.

Jobs

Scheduled execution

any valid Groovy (Java) literal as execution name

According to provided interval/delay or cron expression

Job runs are controlled by the provided interval or cron expression, which are mutually exclusive. The actual code to run as part of the job should be part of the job's closure.

Executions

User-driven execution

any valid Groovy (Java) literal as execution name

By REST call

External executions are invoked via REST requests.

Realms

Event Callback (without return value)

any valid Groovy (Java) literal as realm name with nested blocks:

authenticate
userExists

During user authentication

Newly added realms are added before any built-in realms (Artifactory internal realm, LDAP, Crowd etc.). User authentication will be attempted against these realms first, by the order they are defined.

Build

Event Callback (without return value)

beforeSave 

Before the build info is saved in Artifactory

Handle before build info save events

afterSave 

After the build info is saved in Artifactory

Handle after build info save events

Promotions

User or build server driven execution

any valid Groovy (Java) literal as promotion name

By REST call

Promotes integration (a.k.a. snapshot) build to be a release invoking any code associated with it.

Staging Strategy

build server driven execution

any valid Groovy (Java) literal as staging strategy name

During build server driven staging build configuration

The strategy provides the build server with the following information:

  • How the artifacts in the staged build should be versioned;

  • How the artifacts in the next integration build should be versioned;

  • Should the build server create a release branch/tag/stream in VCS and how it should be called;

  • To which repository in Artifactory the built artifacts should be submitted.

Replication

Event callback (with return value)

beforeFileReplication

Before file is replicated

Handle before file replication events. File replication can be skipped.

beforeDirectoryReplication

Before directory is replicated

Handle before directory replication events. Directory replication can be skipped.

beforeDeleteReplication

Before file/directory is deleted

Handle before file or directory are deleted.

beforePropertyReplication

Before properties are replicated

Handle properties replication.