Managing Artifacts

Upload and manage artifacts in your repository.

  • Organize with paths.
  • Assign versions.
  • Compare SHA256 digests.
  • Download immutable artifacts for devops projects.

Uploading an Artifact

Upload artifacts to your repositories through the Console, Oracle Cloud Infrastructure CLI, or REST APIs.

Use the following table to choose a method to upload your artifacts. For example, for a 3-GB artifact, you can use CLI in Cloud Shell , CLI in your local environment, or REST APIs in your local environment to upload the artifact.

File Size to Upload Console CLI in Cloud Shell CLI in Local Environment API
Less than 200 MB yes yes yes yes
200 MB to 4 GB no yes yes yes
Greater than 4 GB no no yes yes
Note

If your artifact is greater than 200 MB, you can use the Console's Upload Artifact option to build an OCI CLI command with your specifics. You can then paste the command in Cloud Shell or your local environment to upload the artifact.
Using the Console

Upload artifacts to your repositories by using the Console.

  1. Log in to the Oracle Cloud Infrastructure Console.
  2. Open the navigation menu and click Developer Services. Under Containers & Artifacts, click Artifact Registry.
  3. Under List Scope, choose a Compartment that contains your repository.
  4. Click the name of the repository that you want to add your artifacts.
  5. Click Upload artifact.
  6. In the Upload artifact dialog box, specify details for the new artifact:
    • Artifact path: A path of your choice to describe the location of the artifact.

      The artifact path must start with a letter, slash, or underscore, followed by letters, numbers, dashes, slashes, or underscores.

      Slashes do not create a directory structure, but you can use slashes to organize the repository. An artifact path does not include an artifact version.

      Example:
      • project01/my-test-app/test-artifact
      • project01/my-web-app/artifact-abc
    • Version: A string of your choice to describe the version for the artifact.

      Because of incremental updates in artifacts, you assign versions to artifacts. This way, you can associate builds with the artifact versions and roll back to previous versions.

      Example: 1.1.0 or 1.2-beta-2

    The artifact name auto-fills as you enter the path and the version with the format: <artifact-path>:<version>

  7. Click one of the following options:
    • Console (File size less than 200 MB)
      • Drop your artifact in the Content file area.
      • Click Upload.
    • Cloud Shell (File size 200 MB to 4 GB)
      • Launch Cloud Shell.
      • Drop your artifact in the Cloud Shell window.
      • Copy the command generated based on your inputs.
      • Update <file-name> in the command.
      • Run the command in Cloud Shell.
    • CLI (File size greater than 4 GB)
      • Copy the command generated based on your inputs.
      • Update <path-to-file> in the command, with the location of your artifact in your local environment. Example: ./artifact-abc.zip
      • To set up OCI CLI in your local environment, see the following links:
      • Run the command in your local environment.
Using the CLI

Upload artifacts to your repositories by using the OCI CLI.

To upload an artifact into a repository in Artifact Registry, use the artifacts generic artifact resource.

Get all the commands for artifacts generic artifact:

oci artifacts generic artifact -h

Get help for the upload-by-path command:

oci artifacts generic artifact upload-by-path -h

Find the required options:

  • --repository-id
  • --artifact-path (user-defined path to organize artifact in repository)
  • --artifact-version (user-defined version)
  • --content-body (path to artifact in your local environment)

Upload an artifact:

oci artifacts generic artifact upload-by-path --repository-id <repository-OCID> --artifact-path <user-defined-path-for-artifact> --artifact-version <version> --content-body <path-to-artifact-on-local-env>

Example:

oci artifacts generic artifact upload-by-path --repository-id ocid1.artifactrepository.oc1..xxx... --artifact-path project01/my-web-app/artifact-abc --artifact-version 1.0 --content-body <path-to-artifact-on-local-env>
Using the API

Upload artifacts to your repositories by using APIs.

Use the PutGenericArtifactContentByPath operation to upload an artifact in a specific repository.

List the Artifacts

List the artifacts of a specific repository.

Using the Console

List the artifacts of a specific repository by using the Console.

  1. Log in to the Oracle Cloud Infrastructure Console.
  2. Open the navigation menu and click Developer Services. Under Containers & Artifacts, click Artifact Registry.
  3. Under List Scope, select the Compartment that contains your repository.
  4. Click the name of the repository that you want to list its artifacts.
  5. For each listed artifact, view the following properties:
    • Name
    • Artifact path
    • Version
    • State
      • Available
      • Deleted
    • SHA256 digest (A 256-bit Secure Hash Algorithm applied to the artifact when it was uploaded to the repository.)
    • Size (Example: 1.07 MB)
    • Created (creation date and time)
Using the CLI

List the artifacts of a specific repository by using the OCI CLI.

To list all the artifacts of a repository, use the artifacts generic artifact resource.

Get all the commands for artifacts generic artifact:

oci artifacts generic artifact -h

Get help for the list command:

oci artifacts generic artifact list -h

Find the required options for the list command:

  • --compartment-id
  • --repository-id

Get the list of artifacts in a specific repository:

oci artifacts generic artifact list --compartment-id <compartment-OCID> --repository-id <repository-OCID>

Example:

oci artifacts generic artifact list --compartment-id <compartment-OCID> ocid1.compartment.oc1..xxx... --repository-id ocid1.artifactrepository.oc1..xxx...
Using the API

List the artifacts of a specific repository by using APIs.

Use the ListGenericArtifacts operation to list the artifacts of a specific repository.

Getting Artifact Details

View details of a specific artifact.

Using the Console

View details of a specific artifact by using the Console.

  1. Log in to the Oracle Cloud Infrastructure Console.
  2. Open the navigation menu and click Developer Services. Under Containers & Artifacts, click Artifact Registry.
  3. Under List Scope, select the Compartment that contains your repository.
  4. Click the name of the repository that contains your artifact.
  5. Find your artifact in the Artifacts section.
  6. For your artifact, view the following details:
    • Name
    • Artifact path
    • Version
    • State
      • Available
      • Deleted
    • SHA256 digest (A 256-bit Secure Hash Algorithm applied to the artifact when it was uploaded to the repository.) Your options are:
      • Copy
      • Show
    • Size (Example: 1.07 MB)
    • Created (creation date and time)
  7. To get the artifact OCID, click the action menu (three dots) for the artifact and then click Copy OCID.
Using the CLI

View details of a specific artifact by using the OCI CLI.

To view an artifact's details, use the artifacts generic artifact resource.

Get all the commands for artifacts generic artifact:

oci artifacts generic artifact -h

Use one of following commands to view an artifact's details:

  • get
  • get-by-path
Provide the Artifact OCID

View details of a specific artifact by providing the artifact OCID in the OCI CLI.

Get help for the get command:

oci artifacts generic artifact get -h

Find the options to provide for the get command:

--artifact-id

Get details for a specific artifact by providing the artifact OCID:

oci artifacts generic artifact get --artifact-id <artifact-OCID>

Example:

oci artifacts repository get --artifact-id ocid1.genericartifact.oc1..xxx...
Provide the Repository OCID, Artifact Path, and Version

View details of a specific artifact by providing the repository OCID, and the artifact path and version, in the OCI CLI.

Get help for the get-by-path command:

oci artifacts generic artifact get-by-path -h

Find the required options for the get-by-path command:

  • --repository-id
  • --artifact-path
  • --artifact-version
oci artifacts generic artifact get-by-path --repository-id <repository-OCID> --artifact-path <path-defined-for-artifact-in-repo> --artifact-version <version-defined-for-artifact-in-repo>

Get details for a specific artifact by providing its repository, path, and version:

Example:

oci artifacts generic artifact get-by-path --repository-id ocid1.artifactrepository.oc1..xxx... --artifact-path project01/my-web-app/artifact-abc --artifact-version 1.0.0
Using the API

View details of a specific artifact by using APIs.

You can get information about an artifact in two ways:

Downloading an Artifact

Download an artifact to your local environment.

Using the Console

Download an artifact to your local environment by using the Console.

  1. Log in to the Oracle Cloud Infrastructure Console.
  2. Open the navigation menu and click Developer Services. Under Containers & Artifacts, click Artifact Registry.
  3. Under List Scope, select the Compartment that contains your repository.
  4. Click the name of the repository that contains your artifact.
  5. Find your artifact in the Artifacts section.
  6. Click the Actions menu for the artifact and then click Download.
Using the CLI

Download an artifact to your local environment by using the OCI CLI.

To download an artifact to your local environment, use the artifacts generic artifact resource.

Get all the commands for artifacts generic artifact:

oci artifacts generic artifact -h

Use one of following commands to download an artifact to your local environment:

  • download
  • download-by-path
Provide the Artifact OCID

Download an artifact to your local environment by providing the artifact OCID in the OCI CLI.

Get help for the download command:

oci artifacts generic artifact download -h

Find the required options for the download command:

  • --artifact-id
  • --file (The name of the file that will receive the response data, or '-' to write to STDOUT)

Download an artifact by providing its OCID:

oci artifacts generic artifact download --artifact-id <artifact-OCID> --file <name-to-save-for-downloaded-file>

Example:

oci artifacts repository download --artifact-id ocid1.genericartifact.oc1..xxx... --file my-downloaded-file
Provide the Repository OCID, Artifact Path, and Version

Download an artifact to your local environment by providing the repository OCID, and the artifact path and version, in the OCI CLI.

Get help for the download-by-path command:

oci artifacts generic artifact download-by-path -h

Find the required options for the download-by-path command:

  • --repository-id
  • --artifact-path
  • --artifact-version
  • --file (The name of the file that will receive the response data, or '-' to write to STDOUT)
oci artifacts generic artifact download-by-path --repository-id <repository-OCID> --artifact-path <path-defined-for-artifact-in-repo> --artifact-version <version-defined-for-artifact-in-repo> --file <name-to-save-for-downloaded-file>

Get details for a specific artifact by providing its repository, path, and version:

Example:

oci artifacts generic artifact download-by-path --repository-id ocid1.artifactrepository.oc1..xxx... --artifact-path project01/my-web-app/artifact-abc --artifact-version 1.0.0 --file my-downloaded-file
Using the API

Download an artifact to your local environment by using APIs.

You can download an artifact in two ways:

Updating an Artifact

The only property you can update for an artifact is its tags.

Using the Console

Add tags or update an artifact's tags by using the Console.

  1. Log in to the Oracle Cloud Infrastructure Console.
  2. Open the navigation menu and click Developer Services. Under Containers & Artifacts, click Artifact Registry.
  3. Under List Scope, select the Compartment that contains your repository.
  4. Click the name of the repository that contains your artifact.
  5. Find your artifact in the Artifacts section.
  6. Click the Actions menu for the artifact and then click Add Tags.

    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 about tagging, see Resource Tags. If you are not sure if you should add tags, skip this option (you can add tags later) or ask your administrator.

Using the CLI

Add tags or update an artifact's tags by using the OCI CLI.

To update an artifact, use the artifacts generic artifact resource.

Get all the commands for artifacts generic artifact:

oci artifacts generic artifact -h

Use one of following commands to download an artifact to update an artifact:

  • update
  • update-by-path
Provide the Artifact OCID

Add tags or update an artifact's tags by providing the artifact OCID in the OCI CLI.

Get help for the update command:

oci artifacts generic artifact update -h

Find the options to provide for the update command:

  • --artifact-id [required]
  • --freeform-tags (optional)
  • --defined-tags (optional)

Update an artifact's tags by providing its OCID:

oci artifacts generic artifact update --artifact-id <artifact-OCID> --freeform-tags <key-value-pair> --defined-tags <tags-predefined-for-tenancy-namespace>
Provide the Repository OCID, Artifact Path, and Version

Add tags or update an artifact's tags by providing the repository OCID, and the artifact path and version, in the OCI CLI.

Get help for the update-by-path command:

oci artifacts generic artifact update-by-path -h

Find the options to provide for the update-by-path command:

  • --repository-id [required]
  • --artifact-path [required]
  • --artifact-version [required]
  • --freeform-tags (optional)
  • --defined-tags (optional)

Update an artifact's tags by providing its repository, path, and version:

oci artifacts generic artifact update-by-path --repository-id <repository-OCID> --artifact-path <path-defined-for-artifact-in-repo> --artifact-version <version-defined-for-artifact-in-repo> --freeform-tags <key-value-pair> --defined-tags <tags-predefined-for-tenancy-namespace>
Using the API

Add tags or update an artifact's tags by using APIs.

You can update an artifact's tags in two ways:

Deleting an Artifact

Delete artifacts from a repository.

In a repository's detail page:

  • Deleted artifacts remain in the Artifacts section with a Deleted state.
  • You can filter for all artifacts with a Deleted state.
Immutable Artifacts

You can't replace an immutable artifact:

  • When you upload an artifact to an immutable repository, you are not allowed to assign it a deleted artifact's name.
Mutable Artifacts

You can replace a mutable artifact:

  • You can upload an artifact to a mutable repository, assigning it a deleted artifact's name.
  • If an artifact with the same name exists, the new artifact deletes and replaces the old one.
Using the Console

Delete artifacts from a repository by using the Console.

  1. Log in to the Oracle Cloud Infrastructure Console.
  2. Open the navigation menu and click Developer Services. Under Containers & Artifacts, click Artifact Registry.
  3. Under List Scope, select the Compartment that contains your repository.
  4. Click the name of the repository that contains your artifact.
  5. Find your artifact in the Artifacts section.
  6. Click the Actions menu for the artifact and then click Delete.
  7. In the Delete artifact dialog, confirm that you are deleting the correct artifact, and then click Delete.

    In the Artifacts section, the artifact state changes to Deleted.

Using the CLI

Delete artifacts from a repository by using the OCI CLI.

To delete an artifact, use the artifacts generic artifact resource.

Get all the commands for artifacts generic artifact:

oci artifacts generic artifact -h

Use one of following commands to download an artifact to update an artifact:

  • delete
  • delete-by-path
Provide the Artifact OCID

Delete an artifact from a repository by providing the artifact OCID in the OCI CLI.

Get help for the delete command:

oci artifacts generic artifact delete -h

Find the options to provide for the delete command:

--artifact-id

Delete an artifact by providing its OCID:

oci artifacts generic artifact delete --artifact-id <artifact-OCID>

Example:

oci artifacts repository delete --artifact-id ocid1.genericartifact.oc1..xxx...
Provide the Repository OCID, Artifact Path, and Version

Delete an artifact from a repository by providing the repository OCID, and the artifact path and version, in the OCI CLI.

Get help for the delete-by-path command:

oci artifacts generic artifact delete-by-path -h

Find the options to provide for the delete-by-path command:

  • --repository-id
  • --artifact-path
  • --artifact-version

Delete an artifact by providing its repository, path, and version:

oci artifacts generic artifact delete-by-path --repository-id <repository-OCID> --artifact-path <path-defined-for-artifact-in-repo> --artifact-version <version-defined-for-artifact-in-repo>

Example:

oci artifacts generic artifact delete-by-path --repository-id ocid1.artifactrepository.oc1..xxx... --artifact-path project01/my-web-app/artifact-abc --artifact-version 1.0.0
Using the API

Delete an artifact from a repository by using APIs.

You can delete an artifact in two ways:

Searching for Artifacts

Search for artifacts by path or version prefix.

Prefix Search

To organize related artifacts in a repository, you can name them with paths or versions that start with the same string. Then, you can narrow down the list of a repository's artifacts by using a prefix search.

You can use a prefix search for an artifact path or version:

  • Artifact path prefix search: Enter a string to find artifact that begin with that string.

    For example, you can search for project01 prefix and get the following results:

    • project01/my-test-app/test-artifact
    • project01/my-web-app/artifact-abc
  • Version prefix search: Enter a string to find artifact versions that begin with that string.

    For example, you can search for 1.0 prefix and get the following results:

    • 1.0.0.1
    • 1.0.2
Using the Console

Search for artifacts by path or version prefix, by using the Console.

  1. Log in to the Oracle Cloud Infrastructure Console.
  2. Open the navigation menu and click Developer Services. Under Containers & Artifacts, click Artifact Registry.
  3. Under List Scope, select the Compartment that contains your repository.
  4. Click the name of the repository that contains your artifacts.
  5. In the Artifacts section, search for your artifact:
    • Artifact path prefix search:
      • Enter the first few characters of the artifact path in the search field.
      • Press Enter on your keyboard.
      • Sort the displayed artifacts by Name or Artifact path.
    • Version prefix search:
      • Enter the first few characters of the version in the search field.
      • Press Enter on your keyboard.
      • Sort the displayed artifacts by Version.