blob: 341279b99cf5d65fc1eb5331f74e7a3ea2575137 [file] [log] [blame]
Andrea Visnyei6184fcc2020-08-07 12:55:28 +02001.. This work is licensed under a Creative Commons Attribution 4.0
2.. International License. http://creativecommons.org/licenses/by/4.0
3.. Copyright 2020 Nokia.
4
5Setting up environment
6======================
7
8This chapter is based on the `Git Guide <https://docs.releng.linuxfoundation.org/en/latest/git.html>`_
9and the `Gerrit Guide <https://docs.releng.linuxfoundation.org/en/latest/gerrit.html>`_
10in the Linux Foundation Releng Documentation.
11
12Prerequisites
13~~~~~~~~~~~~~
14
15Before you start, you should have an LFID account (sign up
thmsdt40d85182022-07-07 09:39:31 +020016`here <https://identity.linuxfoundation.org/>`_).
Andrea Visnyei6184fcc2020-08-07 12:55:28 +020017
18Installing git
19~~~~~~~~~~~~~~
20
211. Install Git.
22
23 For Debian based systems:
24
25 .. code-block:: bash
26
27 sudo apt-get install git -y
28
29
30 For rpm based systems:
31
32 .. code-block:: bash
33
34 sudo dnf install git -y
35
36
37 For MacOS systems, install `homebrew <http://brew.sh>`_ and install Git
38
39 .. code-block:: bash
40
41 brew install git
42
43.. note:: For more information on git, see the `Git Guide <https://docs.releng.linuxfoundation.org/en/latest/git.html>`_ in the Linux Foundation Releng Documentation.
44
45Configure Git
46~~~~~~~~~~~~~
47
481. Set the author name or email used to sign off a commit with the following commands.
49
50.. code-block:: bash
51
52 git config --local user.name "Your Name"
53 git config --local user.email yourname@example.com
54
55.. note:: Your name and e-mail address (including capitalization) must match the one you entered when creating your LFID account.
56
572. Optionally, change the Git commit editor to your preferred editor, for example, vim.
58
59.. code-block:: bash
60
61 git config --global core.editor "vim"
62
63Installing git-review
64~~~~~~~~~~~~~~~~~~~~~
65
661. Install git-review.
67
68.. code-block:: bash
69
70 pip install git-review
71
thmsdtbf7a1472021-07-29 13:19:59 +020072.. note:: If you dont have pip installed already, follow the `installation documentation <https://pip.pypa.io/en/stable/installation/>`_ for pip.
Andrea Visnyei6184fcc2020-08-07 12:55:28 +020073
74Setting up gerrit
75~~~~~~~~~~~~~~~~~
76
77Setting SSH keys
78----------------
79
801. Generate SSH keys.
81
qingshuting2055c0e2022-05-16 12:41:48 +080082 For OpenSSH 8.7 or older versions:
Andrea Visnyei6184fcc2020-08-07 12:55:28 +020083
qingshuting2055c0e2022-05-16 12:41:48 +080084 .. code-block:: bash
Andrea Visnyei6184fcc2020-08-07 12:55:28 +020085
qingshuting2055c0e2022-05-16 12:41:48 +080086 ssh-keygen -t rsa
87
88 For OpenSSH 8.8 or later versions, either use ed25519 or ECDSA algorithm to generate ssh keys:
89
90 .. code-block:: bash
91
92 ssh-keygen -t ed25519
93
94 or
95
96 .. code-block:: bash
97
98 ssh-keygen -t ECDSA
99
100 .. note:: OpenSSH 8.8+ disables RSA signatures using the SHA-1 hash algorithm by default, which may cause authentication problem when pull/push code. You can either specify the encrypt algorithm or re-enable the RSA/SHA1 in ~/.ssh/config file to solve the issue. For more information, please refer to `OpenSSH Release Notes <https://www.openssh.com/releasenotes.html>`_.
101
102 Your public key is now available as .ssh/id_rsa.pub or .ssh/id_ed25519.pub or .ssh/id_ecdsa.pub under .ssh folder.
Andrea Visnyei6184fcc2020-08-07 12:55:28 +0200103
1042. Print the generated key to the terminal and copy it.
105
106.. code-block:: bash
107
108 cat .ssh/id_rsa.pub
109
1103. On the project gerrit page, go to Settings.
111
112.. figure:: https://docs.releng.linuxfoundation.org/en/latest/_images/gerrit-settings.png
113 :alt: Settings page for your Gerrit account
114 :width: 50 %
115
1164. Click **SSH Public Keys** under **Settings**.
117
1185. Click **Add Key**.
119
1206. In the **Add SSH Public Key** text box, paste the contents of your **id\_rsa.pub** file and then click **Add**.
121
122.. figure:: https://docs.releng.linuxfoundation.org/en/latest/_images/gerrit-ssh-keys.png
123 :alt: Adding your SSH key
124 :width: 50 %
125
126Setting up CLA as an individual contributor
127-------------------------------------------
128
1291. Navigate to **Settings** the gear icon on the upper right corner, and click **Agreements** from the menu on the left:
130
131.. figure:: https://raw.githubusercontent.com/communitybridge/docs/master/.gitbook/assets/settings-icon.png
132
133.. figure:: https://raw.githubusercontent.com/communitybridge/docs/master/.gitbook/assets/agreements.png
134
1352. Click **New Contributor Agreement**.
136
137.. figure:: https://raw.githubusercontent.com/communitybridge/docs/master/.gitbook/assets/agreement-link.png
138
1393. New Contributor Agreement types appear:
140
141.. figure:: https://raw.githubusercontent.com/communitybridge/docs/master/.gitbook/assets/new-contributor-agreement.png
142
1434. Choose the Individual CLA option.
144
145.. figure:: CLA_types.png
146
1475. Click the **Please review the agreement link** and then click the message link that appears:
148
149.. figure:: https://raw.githubusercontent.com/communitybridge/docs/master/.gitbook/assets/cla-gerrit-icla-proceed-to-sign-cla.png
150
1516. Sign in to EasyCLA if you are prompted.
152
1537. Select **Company**.
154
155.. 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.
156
157If any further prompts appear, follow the steps described at the below links:
158
Cédric Ollivier8990c042022-07-05 14:21:44 +0200159- `Individual Contributor <https://docs.linuxfoundation.org/v2/easycla/contributors/individual-contributor#gerrit>`_
160- `Corporate Contributor <https://docs.linuxfoundation.org/v2/easycla/contributors/corporate-contributor#gerrit>`_
Andrea Visnyei6184fcc2020-08-07 12:55:28 +0200161
1628. Complete the form and click **SEND**.
163
164The CCLA manager signs a Corporate CLA and adds you to the approved list.