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_statefrom oci_devops_repository;
select id, name, project_id, project_name, namespace, ssh_url, http_url, default_branch, repository_type, time_created, lifecycle_statefrom 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_statefrom oci_devops_repositorywhere lifecycle_state <> 'ACTIVE';
select id, name, project_id, project_name, repository_type, time_created, lifecycle_statefrom oci_devops_repositorywhere 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_statefrom oci_devops_repositorywhere repository_type = 'HOSTED';
select id, name, project_name, repository_type, time_created, lifecycle_statefrom oci_devops_repositorywhere 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_countfrom oci_devops_repository;
select name, id, branch_count, commit_countfrom 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_statefrom oci_devops_repositorywhere time_created >= now() - interval '30' day;
select name, id, repository_type, time_created, lifecycle_statefrom oci_devops_repositorywhere time_created >= datetime('now', '-30 day');
Schema for oci_devops_repository
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
branch_count | bigint | The count of the branches present in the repository. | |
commit_count | bigint | The count of the commits present in the repository. | |
compartment_id | text | = | The OCID of the compartment in Tenant in which the resource is located. |
default_branch | text | The default branch of the repository. | |
defined_tags | jsonb | Defined 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. | |
description | text | Details of the repository. Avoid entering confidential information. | |
freeform_tags | jsonb | Free-form tags for resource. This tags can be applied by any user with permissions on the resource. | |
http_url | text | HTTP URL that you use to git clone, pull and push. | |
id | text | = | The OCID of the repository. This value is unique and immutable. |
lifecycle_details | text | A message describing the current state in more detail. | |
lifecycle_state | text | = | The current state of the repository. |
mirror_repository_config | jsonb | Mirror repository configuration. | |
name | text | = | Unique name of a repository. This value is mutable. |
namespace | text | Tenancy unique namespace. | |
project_id | text | The OCID of the DevOps project containing the repository. | |
project_name | text | Unique project name in a namespace. | |
region | text | The OCI region in which the resource is located. | |
repository_type | text | Type of repository. | |
size_in_bytes | double precision | The size of the repository in bytes. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
ssh_url | text | SSH URL that you use to git clone, pull and push. | |
system_tags | jsonb | System tags for resource. System tags can be viewed by users, but can only be created by the system. | |
tags | jsonb | A map of tags for the resource. | |
tenant_id | text | =, !=, ~~, ~~*, !~~, !~~* | The OCID of the Tenant in which the resource is located. |
time_created | timestamp with time zone | The time the repository was created. | |
time_updated | timestamp with time zone | The time the repository was updated. | |
title | text | Title of the resource. | |
trigger_build_events | jsonb | Trigger 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