== Dev Week -- Getting started with daily builds in Launchpad -- Quintasan and yofel -- Fri, Mar 4th, 2011 == {{{#!irc [19:01] Logs for this session will be available at http://irclogs.ubuntu.com/2011/03/04/%23ubuntu-classroom.html following the conclusion of the session. === ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu Developer Week - Current Session: Getting started with daily builds in Launchpad - Instructors: Quintasan [19:01] Thanks lukasz! [19:02] So, hi there people. My name is Michał Zając I am a Kubuntu Developer, MOTU and leader of (not famous yet :) Project Neon. [19:02] and today I will be talking about Recipes (or Source Builds) in Launchpad [19:03] We are going to use pbuilder and Launchpad and you should already have those thing if you were at "Getting Started with Development" by dholbach [19:05] I think most people have an idea what {daily,weekly,montly} builds are, if not then here's a quick explanation: we grab code from code repository the project uses, build it and release it as packages [19:07] You probably get the idea that doing that manually every day would be a little annoying at least so our ingenious Launchpad developers introduced the Recipes feature so we can focus more on testing that on writing complicated scripts or doing the builds by hand [19:09] Why should you bother with setting up source builds? Well, testing bleeding edge software goes faster because the packages are very quickly available [19:09] Getting testers is easier too because they just add a PPA instead of compiling the whole source themselves [19:10] Any questions so far? [19:11] Okay, so let's get proceed. [19:12] What do you need to do, to set up your daily builds on Launchpad? [19:12] 1. You need to have your source code on Launchpad (either use code.launchpad.net for developing or request a source import) [19:13] 2. Write a recipe [19:13] 3. Test build it locally (we don't want to stuff Launchpad with failing builds, do we?) [19:13] 4. Upload and trigger the recipe [19:14] Well, I forgot, you also need to have a working packaging for that certain software, that is very important [19:16] So now we're going through steps 2 and 3 beacuse they are essential and setting up a recipe is really easy so I will show that later [19:17] So, go to you working directory and do [19:17] bzr branch lp:~neon/project-neon/kdewebdev-ubuntu [19:18] That's our packaging branch for kdewebdev module, and it's responsible for getting our code compiled and put into packages [19:19] and if you go to [19:19] https://code.launchpad.net/~neon/kdewebdev/trunk [19:19] You can see the already imported code from KDE to Launchpad which we are going to use to get a source build of kdewebdev [19:20] Now we are going to write a recipe, so fire up your favorite text editor [19:20] and paste in the following [19:20] # bzr-builder format 0.2 deb-version 2+svn{date}+r{revno}-{revno:packaging} [19:20] lp:~neon/kdewebdev/trunk [19:20] nest packaging lp:~neon/project-neon/kdewebdev-ubuntu debian [19:21] The first line tells bzr builder how is the versioning of the package going to look === Daviey- is now known as Daviey [19:22] the stuff between { and } is going to expand to [19:22] {date} to date - like 20110301 [19:23] {revno} to revision number of the source so it's also going to be a number like 1677 [19:23] and {revno:packaging} will be substituted with the revno for the branch named packaging in the recipe. [19:24] lp:~neon/kdewebdev/trunk <--- this tells the builder to grab the source from ~neon/kdewebdev/trunk branch [19:25] abhinav: the recipe file can have any name, though I usually name it .recipe [19:26] nest packaging lp:~neon/project-neon/kdewebdev-ubuntu debian [19:26] This line places our packaging in source directory in debian/ [19:27] Please note that the lp:~neon/project-neon/kdewebdev-ubuntu doesn't have debian folder but it's contents [19:27] Otherwise the packaging would land under ./debian/debian and LP wouldn't be able to build it [19:28] Now save the file and we are going to test build it [19:28] Launch a terminal and go the the directory where you saved the recipe file [19:29] make another directory called "build" for example [19:29] hmm, we are actually going to need bzr-builder [19:29] sudo apt-get install bzr-builder [19:29] should install it [19:30] Any questions so far? [19:34] Well, moving on, assuming you have a working pbuilder we have to make a small change to sources.list inside it so we can build it as it pull project-neon libs. Be sure to revert the change after the session [19:34] sudo pbuilder --login --save-after-login <--- that will login into you pbuilder chroot and save any changes you made after exiting [19:35] you will have to add two entries to /etc/apt/sources.list inside your pbuilder [19:36] so open it up for editing and paste [19:36] deb http://ppa.launchpad.net/neon/ppa/ubuntu natty main [19:36] deb-src http://ppa.launchpad.net/neon/ppa/ubuntu natty main [19:36] substitue natty for maverick if you have a maverick pbuilder [19:36] save the file and exit the pbuilder [19:37] sorry, if you do not use pbuilder hooks then do "apt-get update" after adding the entries [19:38] now, back to the recipe directory [19:38] issue the following command [19:39] bzr dailydeb [19:39] here it looks like: bzr dailydeb kdewebdev.recipe build [19:40] What it is going to is to grab the source code, stuff the packaging inside it and create a dsc file which you can build with pbuilder [19:43] after it finishes it work you can build it with pbuilder like this [19:44] sudo pbuilder --build build/*.dsc [19:44] I just finished building it and it should work for you too. [19:45] now that we know the recipe is working we can put it up on Launchpad [19:46] To be able to use Recipes you need to add your launchpad account into Recipe beta users team [19:46] https://launchpad.net/~launchpad-recipe-beta [19:46] It's an open team so anyone can join [19:47] Now what we want to do is to go to the branch with the source code which we are going to use for daily building [19:48] https://code.launchpad.net/~neon/kdewebdev/trunk [19:48] in this case [19:48] If you joined the recipe beta users team you should see "1 recipe using this branch." [19:49] clicking the "1 recipe" link will redirect you to https://code.launchpad.net/~neon/+recipe/project-neon-kdewebdev [19:50] You can see Latest builds section and Recipe contents which contains the exact recipe I gave you [19:50] As you can see there are some successful build [19:50] +s [19:51] Now if you were setting a new daily build then you would click the "Create packaging recipe" button on https://code.launchpad.net/~neon/kdewebdev/trunk [19:51] There are 10 minutes remaining in the current session. [19:52] Set the description and Name fields to you liking [19:52] The Owner field says who can manage the recipe in Launchpad [19:53] The Built daily field has a nice explanation under it: Automatically build each day, if the source has changed. [19:53] And we have to select to which PPA we are going to push the packages [19:53] You can use an existing one or create a new one [19:54] Later you can set the series for which the package will be built, like natty, maverik, lucid and so on up to Dapper [19:54] In the last field you paste the recipe you wrote and click Create Recipe === AlanChicken is now known as AlanBell [19:55] You should be redirected to you recipe page where you can manually trigger the first build by pressing the Request build(s) link under Latest builds section [19:56] There are 5 minutes remaining in the current session. [19:56] If you did everything correctly then it should start building and place the resulting packages in selected PPA [19:57] I'm done, you can find more information about Source Builds at Launchpad Help -> https://help.launchpad.net/Packaging/SourceBuilds [19:57] You can also find me on #project-neon and #kubuntu-devel channels if you need more explanations [19:58] Oh, and there is also a list (not full probably) of existing Daily Builds that are set up on Launchpad [19:58] you can find it on -> https://wiki.ubuntu.com/DailyBuilds/AvailableDailyBuilds [19:59] Well, we are almost out of time and I'm already done, if you have any questions then ask them in #ubuntu-classroom-chat or find me on the channels I mentioned === james_w` is now known as james_w [20:00] Thanks for listening, hope to see some new builds after this session [20:01] here's a more complete list: https://code.launchpad.net/+daily-builds which shows all existing daily build recipes }}}