Adding an Artifact Registry Artifact

Learn how to create a reference to artifacts located in an Artifact Registry repository.

In the build pipeline, to store the Managed Build stage output, you need an OCI Container Registry repository or an Artifact Registry repository.

You must create an artifact reference to point to the repository location containing the build output. Before you create an artifact reference, you must have a DevOps project, and have access to the Artifact Registry repository. See Accessing Artifact Registry.

Oracle Cloud Infrastructure Artifact Registry is a repository service to store, share, and manage software development packages.

You can create a reference to three types of artifacts in Artifact Registry: instance group deployment configurations, general artifacts, and Kubernetes manifests.

For accessing DevOps using the Oracle Cloud Console, REST API, and CLI, see Accessing DevOps.

Using the Console

  1. Open the navigation menu and click Developer Services. Under DevOps, click Projects.
  2. Select an existing project, or create a DevOps project.
  3. Click Add artifact.
  4. Enter a name for the artifact.
  5. For Type, select Instance group deployment configuration, General artifact , or Kubernetes manifest.

    A deployment configuration file defines the artifacts to be downloaded to the instance and the location where the artifacts must be copied. For more information, see Deployment Configuration File.

  6. For Artifact source, select Artifact Registry repository.

    For more information, see Artifact Registry.

  7. To select an Artifact Registry repository, click Select.
  8. Select the region and compartment in which the artifact is located.
  9. Select a repository from the available list.
  10. Select the artifact location. Options are:
    • Select Existing Location: Select an artifact from the chosen repository.
    • Set Custom Location: Enter the path (location) of the artifact that you want to add and enter version of the artifact. The artifact version can also be configured as a parameter. For more information, see Configuring Parameters.
  11. Select Yes, substitute placeholders if you want to replace the placeholders in the artifact content by argument values provided during the deployment. Otherwise, select No. See Configuring Parameters.
  12. (Optional) To add tags to the artifact, click Show tagging options. Tagging is a metadata system that lets you organize and track the resources in your tenancy.

    If you have permissions to create a resource, you also have permissions to add free-form tags to that resource.

    To add a defined tag, you must have permissions to use the tag namespace.

    For more information, see Resource Tags.

  13. Click Add.

A reference to the artifact in the Artifact Registry repository is created.

Using the CLI

To create an Artifact Registry artifact reference, run the create-generic-artifact command:

oci devops deploy-artifact create-generic-artifact

Required parameters for the create-generic-artifact command:

  • --argument-substitution-mode
  • --artifact-path
  • --artifact-version
  • --repository-id
  • --artifact-type
  • --project-id

To get all the commands for deploy-artifact:

oci devops deploy-artifact -h

To get help for the create-generic-artifact command:

oci devops deploy-artifact create-generic-artifact -h

Using the API

To create an Artifact Registry artifact reference, use the CreateDeployArtifact operation. For the deployArtifactType attribute, select one of the following values:

  • DEPLOYMENT_SPEC
  • KUBERNETES_MANIFEST
  • GENERIC_FILE