Creating an External Connection

Create a connection to external repositories such as GitHub, GitLab, Bitbucket Cloud, Visual Builder Studio, Bitbucket Server, and GitLab Server.

Before creating the connection, you must do the following depending on the repository you want to connect to:

  • GitHub Enterprise Cloud, GitLab SaaS, GitLab Server, and Visual Builder Studio: You have to retrieve a personal access token (PAT) from those providers and store your PAT securely in an OCI vault. For instructions, see Build Source Integration.
  • Bitbucket Cloud: You need your Bitbucket username and create an app password, then store the app password in an OCI vault. See Generating an App Password for Bitbucket Cloud.
  • Bitbucket Server: Create HTTP access token and then store the access token in an OCI vault.

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.

    1. Open the navigation menu and click Developer Services. Under DevOps, click Projects.
    2. Select a project and from the left-side menu, click External Connections.
    3. Click Create External Connection.
    4. In the Create external connection panel, provide the following information:
      • Enter a name and description for the connection. Entering a description is optional.
      • Select a type of external connection.

        If you select Bitbucket Cloud, then enter your Bitbucket Username.

      • If you select Bitbucket Server or GitLab Server, enter the Base URL of the hosted Bitbucket Server or GitLab Server. For Visual Builder Studio (VBS), enter the VBS instance's URL.
      • Select the vault and secret value that contains the personal access token (PAT) to connect to GitHub, GitLab, or Visual Builder Studio.

        If you select Bitbucket Cloud, then select the vault value and app password secret.

      • (Optional) For TLS verification configuration, select a CA bundle to authenticate the self-hosted Bitbucket or GitLab server.

        This is not applicable if the repository server (GitLab Server or Bitbucket Server) is hosted with the publicly trusted certificate authority.

      • (Optional) To add tags to the connection, click Show tagging options.

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

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

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

        For more information, see Resource Tags.

    5. Click Create.
      The connection to the selected external repository is successfully created.
    You can now mirror a code repository from GitHub, GitLab, Bitbucket Cloud, or Visual Builder Studio. See Mirroring a Repository.
  • To create a GitHub connection, run the create-github-connection command:

    oci devops connection create-github-connection --personal-access-token, --project-id

    To create a GitLab connection, run the create-gitlab-connection command:

    oci devops connection create-gitlab-connection --personal-access-token, --project-id

    To create a Bitbucket Cloud connection, run the create-bitbucket-cloud-connection command:

    oci devops connection create-bitbucket-cloud-connection --bitbucket-cloud-username, --app-password, --project-id

    To create a Visual Builder Studio connection, run the create-vbs-connection command:

    oci devops connection create-vbs-connection --access-token, --base-url, --project-id

    To create a Bitbucket Server connection, run the create-bitbucket-server-connection command:

    oci devops connection create-bitbucket-server-connection --personal-access-token, --base-url, --project-id

    To create a GitLab Server connection, run the create-gitlab-server-connection command:

    oci devops connection create-gitlab-server-connection --personal-access-token, --base-url, --project-id

    To view list of connections, run the list command:

    oci devops connection list

    To get all the commands for connection:

    oci devops connection -h
  • To create an external connection, use the CreateConnection operation.