Hosting your code on launchpad and bazaar

http://fullcirclemagazine.org/download/issue4_en.pdf

 

Written by Chris Rowson

I recently put some code up onto Launch pad (a superb software development tool from Canonical Limited), but it wasnt immediately apparent to me how to do it. I found tips on a few different web sites, but though t Id bring it all together here for convenience.

Firs t of all youll need a launch pad account. Create one at:

https ://launchpad.net/+ login

Now you require an SSH key. This is s o you can prove to launchpad /bazaar that you are who you say you are. If you dont already have one, heres how to make one.

ssh-keygen -t dsa

You will now be asked for a secret password. Choose one and press enter. Your key has now been generated. You can see it by typing

nano ~/.ssh/id_dsa.pub

Go to your launch pad profile now, and copy/paste the text from the file you opened in the section above, into the section marked Update SSH

Keys. Thats that bit done.

Now you need to introduce yourself to bazaar.

bzr whoami 'Your Name

email@example.com'

To create a bazaar branch on your computer, navigate to the folder that contains you code, and type the following.

bzr init

You now need to tell bazaar which files or folders with in the branch you want to record changes to. Forth is example we have a branch folder called test, which contains the files hello.php, install.txt and a sub folder called stuff.

bzr status

would return

unknown:

hello.php

install.txt

stuff/

You need to tell bazaar which files and folders you want to add to the system. You can do this by issuing the command:

bzr add

This will add all of the files and folders in the current directory recursively. You can also add files and folders individually.

bzr add hello.php

bzr add install.txt

bzr add stuff

If stuff contained any files, those files would be added too.

To remove a file (in this instance ins tall.txt) you can either delete it, the folder on your computer, or run

bzr remove install.txt

 

When you have your code in a state that you want to upload then you need to run the commit command. This creates a revision and allows you to add a message regarding the changes youve made.

bzr commit -m "added my

first file"

You can also selectively commit specific files.

bzr commit -m "added GPL

licence info" install.txt

Now that youve finished editing your code and getting it ready on your local computer, youll want to upload it to launch pad.

bzr push

sftp://UserName@bazaar.launch

pad.net/~UsernameOrTeamName/P

roject/Branch

To break down that url a little more, UserName is your Launch pad username, after the ~ you can then include either your launch pad username or a team name, project is the name of the project in the launch pad url and branch is what you would like to call the branch.

Note that the project must be created in launch pad before you can publish to it. If you dont want to publish to a particular project, you can push to the + junk project instead (Thanks Dean).

So in practice.

bzr push

sftp://uberperson@bazaar.launch

pad.net/~uber-devteam/

ubuntu/development

would create a branch called development in the ubuntu project which can be edited by anyone in uber-dev-team. The person who created this upload would have the username uberperson on launch pad.

Give it a couple of minutes, and you should be able to see your files go live on the launch pad site.

Helpful links:

Full Bazaar Tutorial - http://doc.bazaarvcs.org/bzr.dev/tutorial.htm

 

http://doc.bazaar-vcs.org/bzr.dev/

https://launchpad.net/

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值