Mirroring a Repository

In DevOps, you can mirror a code repository from GitHub, GitLab, Bitbucket Cloud, or Visual Builder Studio. 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. To integrate with GitHub, GitLab, and Visual Builder Studio, you have to create a personal access token (PAT) 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.

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.

Before you mirror a repository, you must have a DevOps project.

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

    1. Open the navigation menu and click Developer Services. Under DevOps, click Projects.
    2. Select a project and from the left-side menu, click Code Repositories.
    3. Click Mirror Repository.
    4. Select a connection to an external repository.
    5. Based on the type of connection make the following selection:
      • For Bitbucket Cloud, select a workspace in the repository.
      • For Visual Builder Studio (VBS), select an external VBS project that contains the repository to be mirrored.
    6. Select a repository.
    7. Select a schedule for synchronizing the repositories. The available options are as follows:
      • Once: The repository is synchronized once after the mirrored repository is created.
      • Default: The repositories are automatically synchronized every 15 minutes after the mirrored repository is created.
      • Custom: Select how often the repositories are synchronized after the mirrored repository is created.
    8. (Optional) Enter a name and description for the repository.
    9. (Optional) To add tags to a repository, click the Actions menu and select Add Tags.

      Tagging is a metadata system that lets you organize and track the resources in your tenancy.

      If you have permission to create a resource, you also have permission to add free-form tags to it.

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

      For more information, see Resource Tags.

    10. Click Mirror Repository.

    See Viewing Code Repository Details. To synchronize the mirrored repository as needed or based on a defined time interval, see Synchronizing a Mirrored Repository. To clone your code repository, see Cloning a Repository.

  • 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
  • To mirror a repository, use the MirrorRepository operation.