Mirroring a Repository
In DevOps, you can mirror a code repository from GitHub, GitLab, or Bitbucket Cloud.
Mirroring allows you to mirror repositories to and from external sources. You can mirror branches and commits between repositories.
Before using an external repository in DevOps, you must create a connection to the repository. DevOps supports connection to GitHub, GitLab, and Bitbucket Cloud. To integrate with these third-party code repositories, you have to create a personal access token (PAT) in GitHub or GitLab and store the PAT in an Oracle Cloud Infrastructure (OCI) vault. For more information, see Build Source Integration. To integrate with Bitbucket Cloud, you have to create a username and app password and store the password in an OCI vault. See Generating an App Password for Bitbucket Cloud.
An authentication (auth) token is required for each user who uses Git to interact with the code repositories in Oracle Cloud.
Required IAM Policy
Each service in OCI integrates with Identity and Access Management (IAM) for authentication and authorization. For creating dynamic groups and policies for code repositories and external connections, see Code Repository Policies. For more details, see DevOps IAM Policies.
For accessing DevOps using the Oracle Cloud Console, REST API, and CLI, see Accessing DevOps.
Using the Console
Before you mirror a repository, you must have a DevOps project.
- Open the navigation menu and click Developer Services. Under DevOps, click Projects.
- Select a project and click Code Repositories on the left-side menu.
- Select a mirrored repository.
- You can perform the following actions on the repository, as needed. These
options are available in the left-side menu of the repository details page:
- To view and access all the files and folders in your repository, click Files. Last commit and update details are also available.
- To view and access all the commits pertaining to the code repository, click Commit. Details such as commit date and author are provided. You can filter the commits by author and date. Each commit is assigned a unique ID, which you can use to track the changes.
- To compare file changes and commit changes between any two branches in your repository, click Compare. Choose a source and target branch to compare.
- To view and access all the available branches in your repository, click Branches.
- To view the various tags that point to specific points in the commits, click Git Tags.
- To monitor the status of all the operations in progress, click Work Requests.
To clone your code repository, see Cloning a Repository.
Using the CLI
To mirror a repository, run the mirror
command:
oci devops repository mirror --repository-id
To get all the commands for repository
:
oci devops repository -h
To get all the commands for mirror
:
oci devops repository mirror -h
Using the API
To mirror a repository, use the MirrorRepository
operation.
Synchronizing a Repository
The mirrored repository can be synchronized as needed or based on a defined time interval.