Use this action to report artifact-related data to an environment from a CloudBees platform workflow run, for artifact traceability purposes.
Prerequisites
Before using this action, you must first register the artifact you plan to deploy to an environment. This registration saves the artifact information to the CloudBees platform.
Do one of the following to save your artifact information to the platform:
-
Use the Register a build artifact action in your workflow in a step prior to using this action.
-
Add a publishing step to your workflow prior to using this action. For example, use one of the following CloudBees actions:
-
Manually create an artifact version in the UI.
All CloudBees action repositories are listed at CloudBees, Inc. on GitHub. |
Inputs
Input name | Data type | Required? | Description |
---|---|---|---|
|
String |
Yes |
The name of the artifact to send to the CloudBees platform. |
|
String |
Yes |
The environment where the deployment is located.
The |
|
String |
Yes |
The URL of the artifact version, for example, |
|
String |
Yes |
The version of the artifact to send to the CloudBees platform. |
|
String |
No |
The artifact digest that uniquely identifies the artifact. |
|
String |
No |
A comma-separated list of artifact labels. |
Usage examples
Basic example
The following is a basic example of using the action:
jobs: register_artifact_version_to_test_env: environment: test_env steps: - name: Register deployed artifact uses: cloudbees-io/register-deployed-artifact@v1 with: name: "myArtifact" target-environment: "test_env" url: "docker.io/myapp/mytestimg:1.0.0" version: "1.0.0"
Full workflow example with Kaniko action
This example publishes an image with Kaniko, and then reports the data to the platform.
Publish and then register deployed artifact
Full workflow example with register build action
The following workflow uses the Register a build artifact action to register the build artifact to the platform.
Then it deploys the artifact to the Docker test
target environment and publishes evidence to the platform.