steampipe plugin install oci

Table: oci_devops_repository - Query OCI DevOps Repositories using SQL

OCI DevOps Repositories is a feature of Oracle Cloud Infrastructure's DevOps service that provides a place for storing, sharing, and versioning application source code. It supports Git-based repositories, enabling teams to collaborate and manage their codebase efficiently. This feature is integral to the CI/CD pipeline, facilitating code changes tracking, branching, and merging.

Table Usage Guide

The oci_devops_repository table provides insights into repositories within OCI DevOps service. As a DevOps engineer, you can explore repository-specific details through this table, including repository names, ids, compartment ids, and associated metadata. Utilize it to manage and audit your repositories, understand their configuration, and identify any potential issues or improvements.

Examples

Basic info

Explore the basic details of your DevOps repositories, such as identity, associated project, URLs, and status. This can help you manage and understand your projects, especially in large or complex environments.

select
id,
name,
project_id,
project_name,
namespace,
ssh_url,
http_url,
default_branch,
repository_type,
time_created,
lifecycle_state
from
oci_devops_repository;
select
id,
name,
project_id,
project_name,
namespace,
ssh_url,
http_url,
default_branch,
repository_type,
time_created,
lifecycle_state
from
oci_devops_repository;

List repositories that are not active

Discover the segments that consist of inactive repositories in your DevOps project. This could be useful to identify and manage unused resources, thereby optimizing your project's performance and cost.

select
id,
name,
project_id,
project_name,
repository_type,
time_created,
lifecycle_state
from
oci_devops_repository
where
lifecycle_state <> 'ACTIVE';
select
id,
name,
project_id,
project_name,
repository_type,
time_created,
lifecycle_state
from
oci_devops_repository
where
lifecycle_state <> 'ACTIVE';

List hosted repositories

Explore which hosted repositories are present in your project by identifying their key details such as ID, name, and creation time. This can be beneficial for understanding the types and states of repositories within your project, aiding in efficient project management.

select
id,
name,
project_name,
repository_type,
time_created,
lifecycle_state
from
oci_devops_repository
where
repository_type = 'HOSTED';
select
id,
name,
project_name,
repository_type,
time_created,
lifecycle_state
from
oci_devops_repository
where
repository_type = 'HOSTED';

Count numbers of commits and branches for each repository

Analyze the activity within each repository by assessing the number of commits and branches. This can provide insights into the level of development and collaboration occurring within each repository, aiding in project management and resource allocation.

select
name,
id,
branch_count,
commit_count
from
oci_devops_repository;
select
name,
id,
branch_count,
commit_count
from
oci_devops_repository;

List repositories created in last 30 days

Discover the segments that were created in the last month. This is useful for tracking recent activity and identifying new additions to your system.

select
name,
id,
repository_type,
time_created,
lifecycle_state
from
oci_devops_repository
where
time_created >= now() - interval '30' day;
select
name,
id,
repository_type,
time_created,
lifecycle_state
from
oci_devops_repository
where
time_created >= datetime('now', '-30 day');

Schema for oci_devops_repository

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
branch_countbigintThe count of the branches present in the repository.
commit_countbigintThe count of the commits present in the repository.
compartment_idtext=The OCID of the compartment in Tenant in which the resource is located.
default_branchtextThe default branch of the repository.
defined_tagsjsonbDefined tags for resource. Defined tags are set up in your tenancy by an administrator. Only users granted permission to work with the defined tags can apply them to resources.
descriptiontextDetails of the repository. Avoid entering confidential information.
freeform_tagsjsonbFree-form tags for resource. This tags can be applied by any user with permissions on the resource.
http_urltextHTTP URL that you use to git clone, pull and push.
idtext=The OCID of the repository. This value is unique and immutable.
lifecycle_detailstextA message describing the current state in more detail.
lifecycle_statetext=The current state of the repository.
mirror_repository_configjsonbMirror repository configuration.
nametext=Unique name of a repository. This value is mutable.
namespacetextTenancy unique namespace.
project_idtextThe OCID of the DevOps project containing the repository.
project_nametextUnique project name in a namespace.
regiontextThe OCI region in which the resource is located.
repository_typetextType of repository.
size_in_bytesdouble precisionThe size of the repository in bytes.
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
ssh_urltextSSH URL that you use to git clone, pull and push.
system_tagsjsonbSystem tags for resource. System tags can be viewed by users, but can only be created by the system.
tagsjsonbA map of tags for the resource.
tenant_idtext=, !=, ~~, ~~*, !~~, !~~*The OCID of the Tenant in which the resource is located.
time_createdtimestamp with time zoneThe time the repository was created.
time_updatedtimestamp with time zoneThe time the repository was updated.
titletextTitle of the resource.
trigger_build_eventsjsonbTrigger build events supported for this repository.

Export

This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- oci

You can pass the configuration to the command with the --config argument:

steampipe_export_oci --config '<your_config>' oci_devops_repository