|
| 1 | +Creating a project from a private repository |
| 2 | +============================================ |
| 3 | + |
| 4 | +.. include:: /shared/admonition-rtd-business.rst |
| 5 | + |
| 6 | +On |com_brand|, projects can be connected to both private and public repositories. |
| 7 | +There are two methods you can use to create a project from a private repository: |
| 8 | + |
| 9 | +`Automatically create a project from a connected repository`_ |
| 10 | + If you have a |git_providers_or| service connected to your account, |
| 11 | + projects can be created automatically from a connected private repository. |
| 12 | + We will handle the configuration of your repository to allow cloning |
| 13 | + and pushing status updates to trigger new builds for your project. |
| 14 | + |
| 15 | + We recommend this method for most projects. |
| 16 | + |
| 17 | +`Manually create a project from a repository`_ |
| 18 | + If your Git provider is unsupported or if your Read the Docs account is not connected to your provider, |
| 19 | + you can still manually create a project against a private repository. |
| 20 | + You will have to manually configure your Git provider and repository after project creation. |
| 21 | + |
| 22 | +Automatically create a project from a connected repository |
| 23 | +---------------------------------------------------------- |
| 24 | + |
| 25 | +.. Putting this section up front to provide a clear focus on automatic project |
| 26 | + connection before pointing users at manual connection |
| 27 | +
|
| 28 | +If your Read the Docs account has a connected |git_providers_or| account, |
| 29 | +you should be able to automatically create a project from your repository. |
| 30 | +Your account will need sufficient permissions to the repository to automatically configure it. |
| 31 | + |
| 32 | +We recommend most users follow our :doc:`directions on automatically creating projects </intro/add-project>` from a connected repository. |
| 33 | + |
| 34 | +Manually create a project from a repository |
| 35 | +------------------------------------------- |
| 36 | + |
| 37 | +In the case that automatic project creation isn't supported or doesn't work for your repository, |
| 38 | +projects may be able to be manually created and configured. |
| 39 | +You can still clone the repository with SSH but you will have to manually |
| 40 | +configure the repository SSH keys and webhooks. |
| 41 | + |
| 42 | +.. seealso:: |
| 43 | + |
| 44 | + :doc:`/guides/setup/git-repo-manual` |
| 45 | + An overview of all of the steps required to manually add a project. |
| 46 | + This guide is useful for both projects using public and private repositories. |
| 47 | + |
| 48 | +Creating a project manually |
| 49 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 50 | + |
| 51 | +.. figure:: /img/screenshots/business-project-manual-team-select.png |
| 52 | + :scale: 40% |
| 53 | + :align: right |
| 54 | + :alt: Select an organization team to create the project in. |
| 55 | + |
| 56 | +#. Select :guilabel:`Add project` from the the main dashboard. |
| 57 | +#. Select :guilabel:`Configure manually` and then :guilabel:`Continue`. |
| 58 | +#. Select the organization team you'd like to create the project for. |
| 59 | + You must be on a team with ``admin`` permission to do this. |
| 60 | + |
| 61 | +In the next form page you will manually configure your project's repository details. |
| 62 | + |
| 63 | +.. figure:: /img/screenshots/business-project-manual-form.png |
| 64 | + :scale: 40% |
| 65 | + :align: right |
| 66 | + :alt: Specify your project and repository configuration. |
| 67 | + |
| 68 | +4. In the :guilabel:`Repository URL` field, provide the repository's SSH or Git URL. |
| 69 | + This URL usually starts with `` git@...``, for example `` [email protected]:readthedocs/readthedocs.org.git``. |
| 70 | +#. In the :guilabel:`Default branch` field, provide the name of the default remote branch. |
| 71 | + This is usually ``main`` or ``master``. |
| 72 | +#. The project's first build should fail to clone your repository. |
| 73 | + This is expected, your repository is not configured to allow access yet. |
| 74 | + |
| 75 | +Configuring your repository |
| 76 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 77 | + |
| 78 | +Each project is configured with an SSH key pair consisting of a public and private key. |
| 79 | +Your repository will need to be configured with the public SSH key |
| 80 | +in order to allow builds to clone your repository. |
| 81 | + |
| 82 | +.. figure:: /img/screenshots/business-project-ssh-key.png |
| 83 | + :scale: 40% |
| 84 | + :align: right |
| 85 | + :alt: Project SSH key details. |
| 86 | + |
| 87 | +#. Go to the :menuselection:`Settings --> SSH keys` page for your project. |
| 88 | +#. Click on the fingerprint of the SSH key. |
| 89 | +#. Copy the text from the :guilabel:`Public SSH key` field |
| 90 | +#. Next, configure your repository with this key, |
| 91 | + we've provided instructions for common Git providers: |
| 92 | + |
| 93 | +.. tabs:: |
| 94 | + |
| 95 | + .. tab:: GitHub |
| 96 | + |
| 97 | + For GitHub, you can use |
| 98 | + `deploy keys with read only access <https://docs.github.com/en/developers/overview/managing-deploy-keys#deploy-keys>`__. |
| 99 | + |
| 100 | + #. Go to your project on GitHub |
| 101 | + #. Click on :guilabel:`Settings` |
| 102 | + #. Click on :guilabel:`Deploy Keys` |
| 103 | + #. Click on :guilabel:`Add deploy key` |
| 104 | + #. Put a descriptive title and paste the public key you copied above. |
| 105 | + #. Click on :guilabel:`Add key` |
| 106 | + |
| 107 | + .. tab:: GitLab |
| 108 | + |
| 109 | + For GitLab, you can use `deploy keys with read only access <https://docs.gitlab.com/ee/user/project/deploy_keys/index.html>`__. |
| 110 | + |
| 111 | + #. Go to your project on GitLab |
| 112 | + #. Click on :guilabel:`Settings` |
| 113 | + #. Click on :guilabel:`Repository` |
| 114 | + #. Expand the :guilabel:`Deploy Keys` section |
| 115 | + #. Put a descriptive title and paste the public key you copied above. |
| 116 | + #. Click on :guilabel:`Add key` |
| 117 | + |
| 118 | + .. tab:: Bitbucket |
| 119 | + |
| 120 | + For Bitbucket, you can use `access keys with read only access <https://confluence.atlassian.com/bitbucket/access-keys-294486051.html>`__. |
| 121 | + |
| 122 | + #. Go your project on Bitbucket |
| 123 | + #. Click on :guilabel:`Repository Settings` |
| 124 | + #. Click on :guilabel:`Access keys` |
| 125 | + #. Click on :guilabel:`Add key` |
| 126 | + #. Put a descriptive label and paste the public key you copied above. |
| 127 | + #. Click on :guilabel:`Add SSH key` |
| 128 | + |
| 129 | + .. tab:: Azure DevOps |
| 130 | + |
| 131 | + For Azure DevOps, you can use `SSH key authentication <https://docs.microsoft.com/en-us/azure/devops/repos/git/use-ssh-keys-to-authenticate?view=azure-devops>`__. |
| 132 | + |
| 133 | + #. Go your Azure DevOps page |
| 134 | + #. Click on :guilabel:`User settings` |
| 135 | + #. Click on :guilabel:`SSH public keys` |
| 136 | + #. Click on :guilabel:`New key` |
| 137 | + #. Put a descriptive name and paste the public key you copied above. |
| 138 | + #. Click on :guilabel:`Add` |
| 139 | + |
| 140 | + .. tab:: Others |
| 141 | + |
| 142 | + If you are using a provider not listed here, |
| 143 | + you should still be able to configure your repository with your project's SSH key. |
| 144 | + Refer to your provider's documentation for managing SSH keys on private repositories. |
| 145 | + |
| 146 | +Configuring repository webhooks |
| 147 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 148 | + |
| 149 | +Your repository will also need to be configured to push updates via webhooks to Read the Docs on repository events. |
| 150 | +Webhook updates are used to to automatically trigger new builds for your project and syncronize your repository's branches and tags. |
| 151 | + |
| 152 | +This step is the same for public repositories, |
| 153 | +follow the directions for :doc:`manually configuring a Git repository integration </guides/setup/git-repo-manual>`. |
0 commit comments