Merge lp:~raoul-snyman/ubuntu-za/bzr-tutorial into lp:ubuntu-za

Proposed by Raoul Snyman
Status: Merged
Merged at revision: 10
Proposed branch: lp:~raoul-snyman/ubuntu-za/bzr-tutorial
Merge into: lp:ubuntu-za
Diff against target: 250 lines (+227/-0)
3 files modified
pages/bazaar-tutorial.rst (+188/-0)
pages/index.rst (+25/-0)
themes/ubuntuza/assets/css/theme.css (+14/-0)
To merge this branch: bzr merge lp:~raoul-snyman/ubuntu-za/bzr-tutorial
Reviewer Review Type Date Requested Status
Gustav H Meyer Approve
Review via email: mp+248434@code.launchpad.net

Description of the change

- Add a Bazaar tutorial
- Added some fancier stuff to the index page

To post a comment you must log in.
Revision history for this message
Gustav H Meyer (inetpro) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'pages/bazaar-tutorial.rst'
2--- pages/bazaar-tutorial.rst 1970-01-01 00:00:00 +0000
3+++ pages/bazaar-tutorial.rst 2015-02-03 18:49:23 +0000
4@@ -0,0 +1,188 @@
5+.. title: Bazaar Tutorial
6+.. slug: bazaar-tutorial
7+.. date: 2015-01-05 23:44:39 UTC+02:00
8+.. tags:
9+.. link:
10+.. description:
11+.. type: text
12+
13+This tutorial will show you how to checkout, modify, commit, and propose a merge for the Ubuntu-ZA web site. While these
14+instructions are specific about the Ubuntu-ZA site, they will work for almost any other project on Launchpad.
15+
16+Set up Launchpad
17+================
18+
19+New to Launchpad?
20+-----------------
21+
22+If you don't have an account on Launchpad.net, go to `<https://launchpad.net/+login>`_ to create one and log in.
23+
24+Generate and Upload SSH Public Key
25+----------------------------------
26+
27+Once you're logged in, you'll need to make sure you have your SSH public key uploaded to your account.
28+
29+Generate SSH Keypair
30+^^^^^^^^^^^^^^^^^^^^
31+
32+SSH uses keypairs, a dual set of keys used to authenticate you against remote services. This keypair consists of a
33+**private key** and a **public key**. To generate a keypair from your terminal, type in::
34+
35+ $ ssh-keygen -t rsa
36+
37+This will create an SSH keypair using the RSA algorithm. Now you need to upload your public key to Launchpad. Display
38+your public key on the terminal by typing in the following::
39+
40+ $ cat ~/.ssh/id_rsa.pub
41+
42+Upload SSH Public Key
43+^^^^^^^^^^^^^^^^^^^^^
44+
45+Once you've done this, go to your Launchpad user page. On your user page there is a section titled, *SSH keys*. Click on
46+the little yellow icon next to it to edit your SSH keys. On the next page, scroll down to the bottom and copy and paste
47+your SSH public key into the text box at the bottom, and click the button to import it.
48+
49+Set up Bazaar
50+=============
51+
52+Identify yourself
53+-----------------
54+
55+You need to configure Bazaar with your name and email address so that your commits can be identified.
56+You should use your email address which is registered on Launchpad::
57+
58+ $ bzr whoami "John Doe <john.doe@example.com>"
59+
60+Log in to Launchpad
61+-------------------
62+
63+Then you need to log into Launchpad from Bazaar. Type in the login command, followed by your Launchpad username::
64+
65+ $ bzr launchpad-login john-doe
66+
67+
68+Set up Projects Environment
69+---------------------------
70+
71+Next you need to set up your directory structure to support using Bazaar and Launchpad.
72+
73+Create a local Projects directory::
74+
75+ $ mkdir ~/Projects
76+
77+Create a local bzr shared repository::
78+
79+ $ cd ~/Projects
80+ $ bzr init-repo ubuntu-za
81+
82+Checkout Main Branch
83+--------------------
84+
85+Now you need to checkout the Ubuntu-ZA site. This means that you're going to tell Bazaar to create a local version of
86+the branch at `lp:ubuntu-za <https://code.launchpad.net/~ubuntu-za-dev/ubuntu-za/website>`_. I like to call it *trunk*
87+because it's connected directly with the primary branch on Launchpad.
88+
89+Checkout the Ubuntu-ZA site::
90+
91+ $ cd ubuntu-za
92+ $ bzr co lp:ubuntu-za trunk
93+
94+This will create a new directory called *trunk* in ``~/Projects/ubuntu-za``.
95+
96+Branching, Pushing, Proposing and Merging
97+=========================================
98+
99+In order to work on the project you need to create branches to do the work in, then push your local branches up to
100+Launchpad, and then propose a merge, and finally merge your changes in to the main branch.
101+
102+Create a Branch
103+---------------
104+
105+To create a new branch, make sure you're in your shared repository directory, and use the ``branch`` command::
106+
107+ $ bzr branch trunk new-contact-page
108+ $ cd new-contact-page
109+
110+Make your edits. Add any new files you have created::
111+
112+ $ vim pages/contact.rst
113+ $ bzr add
114+ adding pages/contact.rst
115+
116+Commit your edits (with a commit message explaining your changes), to save them to your local branch::
117+
118+ $ bzr commit -m "Add a new contact page"
119+ Committing to: ~/Projects/ubuntu-za/new-contact-page/
120+ added pages/contact.rst
121+ Committed revision 8.
122+
123+Push a Branch
124+-------------
125+
126+In order to have your branch visible to the other developers, and in order to propose a merge, you need to push it up
127+to Launchpad. This will create a remote branch on Launchpad, identical to your local branch.
128+
129+Use the ``push`` command::
130+
131+ $ bzr push lp:~john-doe/ubuntu-za/new-contact-page
132+ Using default stacking branch /+branch-id/16860046 at chroot-65050896:///~john-doe/ubuntu-za/
133+ Created new stacked branch referring to /+branch-id/16860046.
134+
135+Each time you push up a branch, it should follow the same pattern::
136+
137+ lp: ~<Launchpad username> / <project name> / <branch name>
138+
139+``lp:``
140+ This is the Launchpad "protocol"
141+
142+``~<Launchpad username>``
143+ This is your username on Launchpad, with a ~ prefixed, and tells Launchpad to associate this branch with you
144+
145+``<project name>``
146+ The project this branch is associated with; in our case, "ubuntu-za"
147+
148+``<branch name>``
149+ This is the name of your remote branch; anything alphanumeric
150+
151+Propose a Merge
152+---------------
153+
154+Go to your branch page on Launchpad. There are two ways to get to your branch page: either via your code page, or via
155+the ``ubuntu-za`` project code page.
156+
157+To get to your code page, go to ``https://code.launchpad.net/~<Launchpad username>``. The ``ubuntu-za`` project code
158+page is just as easy to get to: `<https://code.launchpad.net/ubuntu-za>`_.
159+
160+Next, click on your branch in the list. Then just click on the "Propose Merge" link and propose a merge.
161+
162+Merging
163+-------
164+
165+ **Note:** Merging into trunk is done by the core developers. If you are not a core developer, you won't be able to
166+ commit to trunk.
167+
168+In your local ``trunk`` directory, run the merge command::
169+
170+ $ bzr merge lp:~john-doe/ubuntu-za/new-contact-page
171+ +N pages/contact.rst
172+ All changes applied successfully.
173+
174+This merges the changes from that remote branch into your local files. Now you need to commit those changes into the
175+repository, which will send them up to the main branch::
176+
177+ $ bzr commit -m "Add a new contact page" --author="John Doe <john.doe@example.com>"
178+
179+Once again, you need to specify a commit message (usually just a copy of the merge proposal message or the last commit
180+message in the remote branch), and the author of the commit. This author flag gives credit to the original author of the
181+changes, even if they do not have permission to write to the main repository. Give credit where credit is due.
182+
183+Updating
184+--------
185+
186+Lastly, everyone else who has a copy of ``trunk`` will need to update their copy. Just run the update command::
187+
188+ $ bzr update
189+ +N pages/contact.rst
190+ Updated to revision 8 of branch bzr+ssh://bazaar.launchpad.net/+branch/ubuntu-za
191+
192+And you're done.
193
194=== modified file 'pages/index.rst'
195--- pages/index.rst 2014-12-18 19:58:47 +0000
196+++ pages/index.rst 2015-02-03 18:49:23 +0000
197@@ -14,3 +14,28 @@
198 <p>This is a template for a simple marketing or informational website. It includes a large callout called a jumbotron and three supporting pieces of content. Use it as a starting point to create something more unique.</p>
199 <p><a href="#" class="btn btn-primary btn-lg" role="button">Learn more &raquo;</a></p>
200 </div>
201+
202+.. raw:: html
203+
204+ <div class="container marketing">
205+ <div class="row">
206+ <div class="col-lg-4">
207+ <img class="img-circle" src="data:image/gif;base64,R0lGODlhAQABAIAAAHd3dwAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==" alt="Generic placeholder image" style="width: 140px; height: 140px;">
208+ <h2>Heading</h2>
209+ <p>Donec sed odio dui. Etiam porta sem malesuada magna mollis euismod. Nullam id dolor id nibh ultricies vehicula ut id elit. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna.</p>
210+ <p><a class="btn btn-default" href="#" role="button">View details &raquo;</a></p>
211+ </div><!-- /.col-lg-4 -->
212+ <div class="col-lg-4">
213+ <img class="img-circle" src="data:image/gif;base64,R0lGODlhAQABAIAAAHd3dwAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==" alt="Generic placeholder image" style="width: 140px; height: 140px;">
214+ <h2>Heading</h2>
215+ <p>Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh.</p>
216+ <p><a class="btn btn-default" href="#" role="button">View details &raquo;</a></p>
217+ </div><!-- /.col-lg-4 -->
218+ <div class="col-lg-4">
219+ <img class="img-circle" src="data:image/gif;base64,R0lGODlhAQABAIAAAHd3dwAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==" alt="Generic placeholder image" style="width: 140px; height: 140px;">
220+ <h2>Heading</h2>
221+ <p>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</p>
222+ <p><a class="btn btn-default" href="#" role="button">View details &raquo;</a></p>
223+ </div><!-- /.col-lg-4 -->
224+ </div><!-- /.row -->
225+ </div>
226\ No newline at end of file
227
228=== modified file 'themes/ubuntuza/assets/css/theme.css'
229--- themes/ubuntuza/assets/css/theme.css 2015-01-28 20:41:36 +0000
230+++ themes/ubuntuza/assets/css/theme.css 2015-02-03 18:49:23 +0000
231@@ -73,4 +73,18 @@
232 .subscribe-form {
233 margin-bottom: 1em;
234 text-align: center;
235+}
236+
237+.marketing .col-lg-4 {
238+ margin-bottom: 20px;
239+ text-align: center;
240+}
241+
242+.marketing h2 {
243+ font-weight: normal;
244+}
245+
246+.marketing .col-lg-4 p {
247+ margin-right: 10px;
248+ margin-left: 10px;
249 }
250\ No newline at end of file

Subscribers

People subscribed via source and target branches