Added Git and Gerrit Setup created by Moi 21/10421/1
authorMathieu Lemay <mlemay@inocybe.com>
Thu, 28 Aug 2014 05:05:54 +0000 (01:05 -0400)
committerMathieu Lemay <mlemay@inocybe.com>
Thu, 28 Aug 2014 05:07:04 +0000 (01:07 -0400)
Change-Id: I4de07686e77d7b85b44d5a2982c52a1a1a619a79
Signed-off-by: Mathieu Lemay <mlemay@inocybe.com>
manuals/developers-guide/src/main/asciidoc/bk-developers-guide.adoc
manuals/developers-guide/src/main/asciidoc/section_Git_and_Gerrit_Setup.adoc [new file with mode: 0644]
manuals/developers-guide/src/main/resources/images/Gerrit_settings.jpg [new file with mode: 0644]
manuals/developers-guide/src/main/resources/images/Gerrit_setup.jpg [new file with mode: 0644]
manuals/developers-guide/src/main/resources/images/SSH_keys.jpg [new file with mode: 0644]
manuals/developers-guide/src/main/resources/images/Sign-up with user name.jpg [new file with mode: 0644]
manuals/developers-guide/src/main/resources/images/Sign_in.jpg [new file with mode: 0644]
manuals/developers-guide/src/main/resources/images/form_details.jpg [new file with mode: 0644]
manuals/developers-guide/src/main/resources/images/sign-up.jpg [new file with mode: 0644]
manuals/developers-guide/src/main/resources/images/signup_image.jpg [new file with mode: 0644]

index f344607ed1d45cbdc115e032a0bef9dcb23c8701..300291ee44024851f2c3b09d7c2eef870a6e2233 100644 (file)
@@ -27,6 +27,7 @@ Preface Sub-section
 Preface sub-section body.
 
 include::ch-samplech.adoc[]
+include::section_Git_and_Gerrit_Setup.adoc[]
 
 :numbered!:
 
diff --git a/manuals/developers-guide/src/main/asciidoc/section_Git_and_Gerrit_Setup.adoc b/manuals/developers-guide/src/main/asciidoc/section_Git_and_Gerrit_Setup.adoc
new file mode 100644 (file)
index 0000000..e872154
--- /dev/null
@@ -0,0 +1,144 @@
+== Getting started with Git and Gerrit\r
+\r
+Git is an opensource distributed version control system (dvcs) written in the C language and originally developed by Linus Torvalds and others to manage the Linux kernel. In Git, there is no central copy of the repository. After you have cloned the repository, you have a functioning copy of the source code with all the branches and tagged releases, in your local repository.\r
+\r
+Gerrit is an opensource web-based collaborative code review tool that integrates with Git. It was developed at Google by Shawn Pearce. Gerrit provides a framework for reviewing code commits before they are accepted into the code base. Changes can be uploaded to Gerrit by any user. However, the changes are not made a part of the project until a code review is completed. Gerrit is also a good collaboration tool for storing the conversations that occur around the code commits.\r
+\r
+The OpenDaylight source code is hosted in a repository in Git. Developers must use Gerrit to commit code to the OpenDaylight repository.\r
+\r
+NOTE: For more information on Git, see http://git-scm.com/. For more information on Gerrit, see https://code.google.com/p/gerrit/.\r
+\r
+=== Setting up a Gerrit account\r
+\r
+. Using a Google Chrome or Mozilla Firefox browser, go to https://git.opendaylight.org/gerrit\r
+\r
+The main page shows existing Gerrit requests. These are patches that have been pushed to the repository and not yet verified, reviewed, and merged.\r
+\r
+NOTE: If you already have an OpenDaylight account, you can click *Sign In* in the top right corner of the page and follow the instructions to enter the OpenDaylight page.\r
+\r
+.Signing in to OpenDaylight account\r
+\r
+image::Sign_in.jpg[Signing in to OpenDaylight account]\r
+\r
+[start=2]\r
+\r
+. If you do not have an existing OpenDaylight account, click *Account signup/management* on the top bar of the main Gerrit page.\r
+\r
+The *WS02 Identity Server* page is displayed.\r
+\r
+\r
+.Gerrit Account signup/management link\r
+\r
+image::Gerrit_setup.jpg[Account signup/management link]\r
+\r
+[start=3]\r
+\r
+. In the *WS02 Identity Server* page, click *Sign-up* in the left pane.\r
+\r
+There is also an option to authenticate your sign in with OpenID. This option is not described in this document.\r
+\r
+.Sign-up link for Gerrit account\r
+\r
+image::sign-up.jpg[Sign-up link for Gerrit account]\r
+\r
+[start=4]\r
+\r
+. Click on the *Sign-up with User Name/Password* image on the right pane to continue to the actual sign-up page.\r
+\r
+.Sign-up with User Name/Password Image\r
+\r
+image::signup_image.jpg[Sign-up with User Name / Password Image]\r
+\r
+[start=5]\r
+\r
+. Fill out the details in the account creation form and then click *Submit*.\r
+\r
+.Filling out the details\r
+\r
+image::form_details.jpg[Filling out the details]\r
+\r
+You now have an OpenDaylight account that can be used with Gerrit to pull the OpenDaylight code.\r
+\r
+=== Generating SSH keys for your system\r
+\r
+You must have SSH keys for your system to register with your Gerrit account. The method for generating SSH keys is different for different types of operating systems.\r
+\r
+The key you register with Gerrit must be identical to the one you will use later to pull or edit the code. For example, if you have a development VM which has a different UID login and keygen than that of your laptop, the SSH key you generate for the VM is different from the laptop. If you register the SSH key generated on your VM with Gerrit and do not reuse it on your laptop when using Git on the laptop, the pull fails.\r
+\r
+NOTE: For more information on SSH keys for Ubuntu, see https://help.ubuntu.com/community/SSH/OpenSSH/Keys. For generating SSH keys for Windows, see https://help.github.com/articles/generating-ssh-keys.\r
+\r
+For a system running Ubuntu operating system, follow the steps below:\r
+\r
+. Run the following command:\r
+\r
+[literal]\r
+\r
+mkdir ~/.ssh\r
+chmod 700 ~/.ssh\r
+ssh-keygen -t rsa\r
+\r
+[start=2]\r
+\r
+. You are prompted for a location to save the keys, and a passphrase for the keys.\r
+\r
+This passphrase protects your private key while it is stored on the hard drive. You must use the passphrase to use the keys every time you need to login to a key-based system.\r
+\r
+[literal]\r
+\r
+Generating public/private rsa key pair.\r
+Enter file in which to save the key (/home/b/.ssh/id_rsa):\r
+Enter passphrase (empty for no passphrase):\r
+Enter same passphrase again:\r
+Your identification has been saved in /home/b/.ssh/id_rsa.\r
+Your public key has been saved in /home/b/.ssh/id_rsa.pub.\r
+\r
+Your public key is now available as *.ssh/id_rsa.pub* in your home folder.\r
+\r
+=== Registering your SSH key with Gerrit\r
+\r
+. Using a Google Chrome or Mozilla Firefox browser, go to https://git.opendaylight.org/gerrit.\r
+\r
+[start=2]\r
+. Click *Sign In* to access the OpenDaylight repository.\r
+\r
+.Signin in to OpenDaylight repository\r
+\r
+image::Sign_in.jpg[Signin in to OpenDaylight repository]\r
+\r
+[start=3]\r
+. Click your name in the top right corner of the window and then click *Settings*.\r
+\r
+The *Settings* page is displayed.\r
+\r
+.Settings page for your Gerrit account\r
+\r
+image::Gerrit_settings.jpg[Settings page for your Gerrit account]\r
+\r
+[start=4]\r
+. Click *SSH Public Keys* under *Settings*.\r
+\r
+. Click *Add Key*.\r
+\r
+. In the *Add SSH Public Key* text box, paste the contents of your *id_rsa.pub* file and then click *Add*.\r
+\r
+.Adding your SSH key\r
+\r
+image::SSH_keys.jpg[Adding your SSH key]\r
+\r
+To verify your SSH key is working correctly, try using an SSH client to connect to Gerrit's SSHD port. \r
+\r
+[literal]\r
+\r
+$ ssh -p 29418 <sshusername>@git.opendaylight.org\r
+Enter passphrase for key '/home/cisco/.ssh/id_rsa': \r
+****    Welcome to Gerrit Code Review    ****\r
+Hi <user>, you have successfully connected over SSH.\r
+Unfortunately, interactive shells are disabled.\r
+To clone a hosted Git repository, use: git clone ssh://<user>@git.opendaylight.org:29418/REPOSITORY_NAME.git\r
+Connection to git.opendaylight.org closed.\r
+\r
+You can now proceed to either Pulling, Hacking, and Pushing the Code from the CLI or Pulling, Hacking, and Pushing the Code from Eclipse depending on your implementation.\r
+\r
+\r
+\r
+\r
diff --git a/manuals/developers-guide/src/main/resources/images/Gerrit_settings.jpg b/manuals/developers-guide/src/main/resources/images/Gerrit_settings.jpg
new file mode 100644 (file)
index 0000000..847a452
Binary files /dev/null and b/manuals/developers-guide/src/main/resources/images/Gerrit_settings.jpg differ
diff --git a/manuals/developers-guide/src/main/resources/images/Gerrit_setup.jpg b/manuals/developers-guide/src/main/resources/images/Gerrit_setup.jpg
new file mode 100644 (file)
index 0000000..c00e4bc
Binary files /dev/null and b/manuals/developers-guide/src/main/resources/images/Gerrit_setup.jpg differ
diff --git a/manuals/developers-guide/src/main/resources/images/SSH_keys.jpg b/manuals/developers-guide/src/main/resources/images/SSH_keys.jpg
new file mode 100644 (file)
index 0000000..a46ced3
Binary files /dev/null and b/manuals/developers-guide/src/main/resources/images/SSH_keys.jpg differ
diff --git a/manuals/developers-guide/src/main/resources/images/Sign-up with user name.jpg b/manuals/developers-guide/src/main/resources/images/Sign-up with user name.jpg
new file mode 100644 (file)
index 0000000..4c298e0
Binary files /dev/null and b/manuals/developers-guide/src/main/resources/images/Sign-up with user name.jpg differ
diff --git a/manuals/developers-guide/src/main/resources/images/Sign_in.jpg b/manuals/developers-guide/src/main/resources/images/Sign_in.jpg
new file mode 100644 (file)
index 0000000..3033da3
Binary files /dev/null and b/manuals/developers-guide/src/main/resources/images/Sign_in.jpg differ
diff --git a/manuals/developers-guide/src/main/resources/images/form_details.jpg b/manuals/developers-guide/src/main/resources/images/form_details.jpg
new file mode 100644 (file)
index 0000000..f1628fc
Binary files /dev/null and b/manuals/developers-guide/src/main/resources/images/form_details.jpg differ
diff --git a/manuals/developers-guide/src/main/resources/images/sign-up.jpg b/manuals/developers-guide/src/main/resources/images/sign-up.jpg
new file mode 100644 (file)
index 0000000..06c1938
Binary files /dev/null and b/manuals/developers-guide/src/main/resources/images/sign-up.jpg differ
diff --git a/manuals/developers-guide/src/main/resources/images/signup_image.jpg b/manuals/developers-guide/src/main/resources/images/signup_image.jpg
new file mode 100644 (file)
index 0000000..4c298e0
Binary files /dev/null and b/manuals/developers-guide/src/main/resources/images/signup_image.jpg differ