Download presentation
Presentation is loading. Please wait.
Published byClifton Walton Modified over 8 years ago
1
Launchpad & Bazaar Use Launchpad to work on team projects http://www.launchpad.net Use Bazaar a Distributed Version Control System D-VCS
2
Launchpad & Bazaar: SSH Key Browse to http://www.launchpad.net and create an account: usernamehttp://www.launchpad.net Generate a ssh-key on your machine: Open a terminal Install ssh: sudo apt-get install openssh-client Generate a key: ssh-keygen -t rsa When prompted, press Enter to accept the default file name for your key Enter a password (Optional) Public key is stored in: ~/.ssh/id_rsa.pub Private key (secret!) is stored in: ~/.ssh/id_rsa.pub
3
Launchpad & Bazaar: SSH Key Upload the ssh-key to launchpad Browse to http://www.launchpad.net/~username You will see a place that says SSH Keys with an exclamation point (!) in a yellow circle next to it Click on the (!) scroll down until you see Add an SSH Key and a text box We will paste our public key into this text box: In a terminal: gedit ~/.ssh/id_rsa.pub & Copy and paste from gedit to the web browser Now simply click on the button Import Public Key Each computer you use, you need to import the ssh-key
4
Launchpad & Bazaar: Bazaar Bazaar is a Version Control Software (VCS) bzr is the main command to use Create a branch to hold your code: bzr init Add files to your branch: bzr add Tell bzr who you are: bzr whoami Change and commit code to your branch: bzr commit See what has not been commited: bzr status See what changes have been made: bzr log Make a copy of a branch: bzr branch Install bzr: sudo apt-get install bzr bzrtool
5
Launchpad & Bazaar: Locations Bazaar can work with files on your computer Launchpad has a Bazaar service you can use to host branches Files are publically readable You can control who can change the files by individual or teams Don't have to worry about backing up source code Create a project on launchpad to hold multiple branches: ihris-manage, i2ce, ihris-manage-lesotho Use the translation capabilities built into launchpad bzr knows about launchpad – it's easy!
6
Launchpad & Bazaar: Example Our playground: http://staging.launchpad.net Create a ”hello world” application in PHP work in teams
7
Launchpad & Bazaar: Teams Our playground: http://staging.launchpad.net/~his-workshop-teamZ Launchpad uses teams to control who can modify code it stores under bazaar Split up into teams Designate a team owner Create a team his-workshop-teamZ Everyone join the team
8
Launchpad & Bazaar: Project Our playground: https://staging.launchpad.net/his-helloworld-Z Launchpad uses projects to group related code (branches), manage software releases, translations, etc Create a project his-helloworld-Z GPL V3 Assign your teams as the Maintainer of the project: Click the yellow exclamation point
9
Apache: helloworld.php Owner creates a directory for trunk of our hello world web application mkdir -p ~/helloworld/trunk Create our helloworld.php gedit ~/helloworld/trunk/helloworld.php Add the following to our helloworld.php <?php echo ” Hello HIS Gathering \n”; Make it available to apache webserver sudo ln -s ~/helloworld/trunk /var/www/helloworld
10
Bazaar: Initial Commit Team owner needs to make the bzr branch and the intial commit cd ~/helloworld/trunk bzr init bzr add bzr commit -m ”Initial code for hello world application”
11
Bazaar & Launchpad: Putting the Code on Launchpad Team owner goes to ”Registers a Branch” at: https://code.staging.launchpad.net/his-helloworld-Z Owner: his-workshop-teamZ Name: trunk Branch Type: hosted Team owner puts the code on launchpad cd ~/helloworld/trunk bzr push --use-existing-dir lp://staging/~his-workshop/his-helloworld-Z/trunk bzr bind lp://staging/~his-workshop/his-helloworld-Z/trunk
12
Bazaar Launchpad: Getting the code Other team members want to checkout code. Get a copy of the code from launchpad mkdir ~/helloworld bzr branch lp://staging/~his-workshop/his-helloworld-Z/trunk Bind the code to launchpad – all commited changes automatically go to launchpad cd ~/helloworld/trunk bzr bind lp://staging/~his-workshop/his-helloworld-Z/trunk
13
Bazaar & Launchpad: Commits Team owner needs to make the intial commit If we commit to the (unbound) branches changes are only local – they do not get pushed up to launchpad automatically To put changes to code on launchpad can use: bzr checkout: use instead of bzr branch bzr push: if you used bzr branch this will move committed code to launchpad one time only bzr bind: changes a bzr branch to a bzr checkout bzr info: tells you what is going on
14
Changing The Code Other team member wants to add a footer file cd ~/helloworld/trunk gedit footer.php Add the contents and save: echo ” Today is ”. date("D, d M Y"). ” \n”; Edit the helloworld.php gedit helloworld.php Append the line to the end of the file and save: include(”footer.php”);
15
Committing the Changes Commit the changes to launchpad cd ~/helloworld/trunk bzr add footer.php bzr commit -m ”Added footer” Look at changes at: https://code.staging.launchpad.net/his-helloworld-Z Team members get changes: cd ~/helloworld/trunk bzr update
16
Renaming files Team member notices helloworld should be index cd ~/helloworld/trunk bzr mv helloworld.php index.php bzr commit -m ”Renamed helloworld.php to index.php” Team members get changes: cd ~/helloworld/trunk bzr update
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.