From: Andrea Visnyei Date: Fri, 7 Aug 2020 10:55:28 +0000 (+0200) Subject: Adding environment setup chapter X-Git-Url: https://gerrit.onap.org/r/gitweb?p=doc.git;a=commitdiff_plain;h=6184fccc1d750fda60eb8bc4fe3b3c368253b68a Adding environment setup chapter Added info on git/gerrit setup to doc guide. Issue-ID: DOC-654 Change-Id: Ia9ca52b0277a18bb8934f15d1a5ec89a1f88cc9e Signed-off-by: Andrea Visnyei --- diff --git a/docs/guides/onap-developer/how-to-use-docs/CLA_types.png b/docs/guides/onap-developer/how-to-use-docs/CLA_types.png new file mode 100644 index 000000000..d687135af Binary files /dev/null and b/docs/guides/onap-developer/how-to-use-docs/CLA_types.png differ diff --git a/docs/guides/onap-developer/how-to-use-docs/index.rst b/docs/guides/onap-developer/how-to-use-docs/index.rst index 15ca7f3f2..ddcdcb493 100644 --- a/docs/guides/onap-developer/how-to-use-docs/index.rst +++ b/docs/guides/onap-developer/how-to-use-docs/index.rst @@ -9,7 +9,8 @@ Creating Documentation introduction style-guide - setting-up + setting-up-environment + include-documentation api-swagger-guide converting-to-rst addendum diff --git a/docs/guides/onap-developer/how-to-use-docs/setting-up-environment.rst b/docs/guides/onap-developer/how-to-use-docs/setting-up-environment.rst new file mode 100644 index 000000000..821ee8c68 --- /dev/null +++ b/docs/guides/onap-developer/how-to-use-docs/setting-up-environment.rst @@ -0,0 +1,150 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 +.. International License. http://creativecommons.org/licenses/by/4.0 +.. Copyright 2020 Nokia. + +Setting up environment +====================== + +This chapter is based on the `Git Guide `_ +and the `Gerrit Guide `_ +in the Linux Foundation Releng Documentation. + +Prerequisites +~~~~~~~~~~~~~ + +Before you start, you should have an LFID account (sign up +`here `_). + +Installing git +~~~~~~~~~~~~~~ + +1. Install Git. + + For Debian based systems: + + .. code-block:: bash + + sudo apt-get install git -y + + + For rpm based systems: + + .. code-block:: bash + + sudo dnf install git -y + + + For MacOS systems, install `homebrew `_ and install Git + + .. code-block:: bash + + brew install git + +.. note:: For more information on git, see the `Git Guide `_ in the Linux Foundation Releng Documentation. + +Configure Git +~~~~~~~~~~~~~ + +1. Set the author name or email used to sign off a commit with the following commands. + +.. code-block:: bash + + git config --local user.name "Your Name" + git config --local user.email yourname@example.com + +.. note:: Your name and e-mail address (including capitalization) must match the one you entered when creating your LFID account. + +2. Optionally, change the Git commit editor to your preferred editor, for example, vim. + +.. code-block:: bash + + git config --global core.editor "vim" + +Installing git-review +~~~~~~~~~~~~~~~~~~~~~ + +1. Install git-review. + +.. code-block:: bash + + pip install git-review + +.. note:: If you don’t have pip installed already, follow the `installation documentation `_ for pip. + +Setting up gerrit +~~~~~~~~~~~~~~~~~ + +Setting SSH keys +---------------- + +1. Generate SSH keys. + +.. code-block:: bash + + ssh-keygen -t rsa + +Your public key is now available as .ssh/id_rsa.pub in your home folder. + +2. Print the generated key to the terminal and copy it. + +.. code-block:: bash + + cat .ssh/id_rsa.pub + +3. On the project gerrit page, go to Settings. + +.. figure:: https://docs.releng.linuxfoundation.org/en/latest/_images/gerrit-settings.png + :alt: Settings page for your Gerrit account + :width: 50 % + +4. Click **SSH Public Keys** under **Settings**. + +5. Click **Add Key**. + +6. In the **Add SSH Public Key** text box, paste the contents of your **id\_rsa.pub** file and then click **Add**. + +.. figure:: https://docs.releng.linuxfoundation.org/en/latest/_images/gerrit-ssh-keys.png + :alt: Adding your SSH key + :width: 50 % + +Setting up CLA as an individual contributor +------------------------------------------- + +1. Navigate to **Settings** — the gear icon on the upper right corner, and click **Agreements** from the menu on the left: + +.. figure:: https://raw.githubusercontent.com/communitybridge/docs/master/.gitbook/assets/settings-icon.png + +.. figure:: https://raw.githubusercontent.com/communitybridge/docs/master/.gitbook/assets/agreements.png + +2. Click **New Contributor Agreement**. + +.. figure:: https://raw.githubusercontent.com/communitybridge/docs/master/.gitbook/assets/agreement-link.png + +3. New Contributor Agreement types appear: + +.. figure:: https://raw.githubusercontent.com/communitybridge/docs/master/.gitbook/assets/new-contributor-agreement.png + +4. Choose the Individual CLA option. + +.. figure:: CLA_types.png + +5. Click the **Please review the agreement link** and then click the message link that appears: + +.. figure:: https://raw.githubusercontent.com/communitybridge/docs/master/.gitbook/assets/cla-gerrit-icla-proceed-to-sign-cla.png + +6. Sign in to EasyCLA if you are prompted. + +7. Select **Company**. + +.. note:: To contribute to this project, you must be authorized under a signed Contributor License Agreement. You are contributing on behalf of your work for a company. + +If any further prompts appear, follow the steps described at the below links: + +- `If a Confirmation of Association with statement appears `_ +- `If your company has not signed CCLA `_ +- `If you are not added to the approved list `_ +- `If Company is not in the list `_ + +8. Complete the form and click **SEND**. + +The CCLA manager signs a Corporate CLA and adds you to the approved list.