Dev Week -- Getting started with daily builds in Launchpad -- Quintasan and yofel -- Fri, Mar 4th, 2011

   1 [19:01] <ClassBot> Logs for this session will be available at following the conclusion of the session.
   2 === ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - || Support in #ubuntu || Upcoming Schedule: || Questions in #ubuntu-classroom-chat || Event: Ubuntu Developer Week - Current Session: Getting started with daily builds in Launchpad - Instructors: Quintasan
   3 [19:01] <Quintasan> Thanks lukasz!
   4 [19:02] <Quintasan> So, hi there people. My name is Michał Zając I am a Kubuntu Developer, MOTU and leader of (not famous yet :) Project Neon.
   5 [19:02] <Quintasan> and today I will be talking about Recipes (or Source Builds)  in Launchpad
   6 [19:03] <Quintasan> 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
   7 [19:05] <Quintasan> 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
   8 [19:07] <Quintasan> 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
   9 [19:09] <Quintasan> Why should you bother with setting up source builds? Well, testing bleeding edge software goes faster because the packages are very quickly available
  10 [19:09] <Quintasan> Getting testers is easier too because they just add a PPA instead of compiling the whole source themselves
  11 [19:10] <Quintasan> Any questions so far?
  12 [19:11] <Quintasan> Okay, so let's get proceed.
  13 [19:12] <Quintasan> What do you need to do, to set up your daily builds on Launchpad?
  14 [19:12] <Quintasan> 1. You need to have your source code on Launchpad (either use for developing or request a source import)
  15 [19:13] <Quintasan> 2. Write a recipe
  16 [19:13] <Quintasan> 3. Test build it locally (we don't want to stuff Launchpad with failing builds, do we?)
  17 [19:13] <Quintasan> 4. Upload and trigger the recipe
  18 [19:14] <Quintasan> Well, I forgot, you also need to have a working packaging for that certain software, that is very important
  19 [19:16] <Quintasan> 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
  20 [19:17] <Quintasan> So, go to you working directory and do
  21 [19:17] <Quintasan> bzr branch lp:~neon/project-neon/kdewebdev-ubuntu
  22 [19:18] <Quintasan> That's our packaging branch for kdewebdev module, and it's responsible for getting our code compiled and put into packages
  23 [19:19] <Quintasan> and if you go to
  24 [19:19] <Quintasan>
  25 [19:19] <Quintasan> You can see the already imported code from KDE to Launchpad which we are going to use to get a source build of kdewebdev
  26 [19:20] <Quintasan> Now we are going to write a recipe, so fire up your favorite text editor
  27 [19:20] <Quintasan> and paste in the following
  28 [19:20] <Quintasan> # bzr-builder format 0.2 deb-version 2+svn{date}+r{revno}-{revno:packaging}
  29 [19:20] <Quintasan> lp:~neon/kdewebdev/trunk
  30 [19:20] <Quintasan> nest packaging lp:~neon/project-neon/kdewebdev-ubuntu debian
  31 [19:21] <Quintasan> The first line tells bzr builder how is the versioning of the package going to look
  32 === Daviey- is now known as Daviey
  33 [19:22] <Quintasan> the stuff between { and } is going to expand to
  34 [19:22] <Quintasan> {date} to date - like 20110301
  35 [19:23] <Quintasan> {revno} to revision number of the source so it's also going to be a number like 1677
  36 [19:23] <Quintasan> and {revno:packaging} will be substituted with the revno for the branch named packaging in the recipe.
  37 [19:24] <Quintasan> lp:~neon/kdewebdev/trunk <--- this tells the builder to grab the source from ~neon/kdewebdev/trunk branch
  38 [19:25] <Quintasan> abhinav: the recipe file can have any name, though I usually name it <project>.recipe
  39 [19:26] <Quintasan> nest packaging lp:~neon/project-neon/kdewebdev-ubuntu debian
  40 [19:26] <Quintasan> This line places our packaging in source directory in debian/
  41 [19:27] <Quintasan> Please note that the lp:~neon/project-neon/kdewebdev-ubuntu doesn't have debian folder but it's contents
  42 [19:27] <Quintasan> Otherwise the packaging would land under ./debian/debian and LP wouldn't be able to build it
  43 [19:28] <Quintasan> Now save the file and we are going to test build it
  44 [19:28] <Quintasan> Launch a terminal and go the the directory where you saved the recipe file
  45 [19:29] <Quintasan> make another directory called "build" for example
  46 [19:29] <Quintasan> hmm, we are actually going to need bzr-builder
  47 [19:29] <Quintasan> sudo apt-get install bzr-builder
  48 [19:29] <Quintasan> should install it
  49 [19:30] <Quintasan> Any questions so far?
  50 [19:34] <Quintasan> 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
  51 [19:34] <Quintasan> sudo pbuilder --login --save-after-login <--- that will login into you pbuilder chroot and save any changes you made after exiting
  52 [19:35] <Quintasan> you will have to add two entries to /etc/apt/sources.list inside your pbuilder
  53 [19:36] <Quintasan> so open it up for editing and paste
  54 [19:36] <Quintasan> deb natty main
  55 [19:36] <Quintasan> deb-src natty main
  56 [19:36] <Quintasan> substitue natty for maverick if you have a maverick pbuilder
  57 [19:36] <Quintasan> save the file and exit the pbuilder
  58 [19:37] <Quintasan> sorry, if you do not use pbuilder hooks then do "apt-get update" after adding the entries
  59 [19:38] <Quintasan> now, back to the recipe directory
  60 [19:38] <Quintasan> issue the following command
  61 [19:39] <Quintasan> bzr dailydeb <your recipe file> <build directory we created earlier>
  62 [19:39] <Quintasan> here it looks like: bzr dailydeb kdewebdev.recipe build
  63 [19:40] <Quintasan> 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
  64 [19:43] <Quintasan> after it finishes it work you can build it with pbuilder like this
  65 [19:44] <Quintasan> sudo pbuilder --build build/*.dsc
  66 [19:44] <Quintasan> I just finished building it and it should work for you too.
  67 [19:45] <Quintasan> now that we know the recipe is working we can put it up on Launchpad
  68 [19:46] <Quintasan> To be able to use Recipes you need to add your launchpad account into Recipe beta users team
  69 [19:46] <Quintasan>
  70 [19:46] <Quintasan> It's an open team so anyone can join
  71 [19:47] <Quintasan> 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
  72 [19:48] <Quintasan>
  73 [19:48] <Quintasan> in this case
  74 [19:48] <Quintasan> If you joined the recipe beta users team you should see "1 recipe using this branch."
  75 [19:49] <Quintasan> clicking the "1 recipe" link will redirect you to
  76 [19:50] <Quintasan> You can see Latest builds section and Recipe contents which contains the exact recipe I gave you
  77 [19:50] <Quintasan> As you can see there are some successful build
  78 [19:50] <Quintasan> +s
  79 [19:51] <Quintasan> Now if you were setting a new daily build then you would click the "Create packaging recipe" button on
  80 [19:51] <ClassBot> There are 10 minutes remaining in the current session.
  81 [19:52] <Quintasan> Set the description and Name fields to you liking
  82 [19:52] <Quintasan> The Owner field says who can manage the recipe in Launchpad
  83 [19:53] <Quintasan> The Built daily field has a nice explanation under it: Automatically build each day, if the source has changed.
  84 [19:53] <Quintasan> And we have to select to which PPA we are going to push the packages
  85 [19:53] <Quintasan> You can use an existing one or create a new one
  86 [19:54] <Quintasan> Later you can set the series for which the package will be built, like natty, maverik, lucid and so on up to Dapper
  87 [19:54] <Quintasan> In the last field you paste the recipe you wrote and click Create Recipe
  88 === AlanChicken is now known as AlanBell
  89 [19:55] <Quintasan> 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
  90 [19:56] <ClassBot> There are 5 minutes remaining in the current session.
  91 [19:56] <Quintasan> If you did everything correctly then it should start building and place the resulting packages in selected PPA
  92 [19:57] <Quintasan> I'm done, you can find more information about Source Builds at Launchpad Help ->
  93 [19:57] <Quintasan> You can also find me on #project-neon and #kubuntu-devel channels if you need more explanations
  94 [19:58] <Quintasan> Oh, and there is also a list (not full probably) of existing Daily Builds that are set up on Launchpad
  95 [19:58] <Quintasan> you can find it on ->
  96 [19:59] <Quintasan> 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
  97 === james_w` is now known as james_w
  98 [20:00] <Quintasan> Thanks for listening, hope to see some new builds after this session
  99 [20:01] <yofel> here's a more complete list: which shows all existing daily build recipes

MeetingLogs/devweek1103/GettingStartedWithDailyBuildsInLaunchpad (last edited 2011-03-05 04:44:06 by nigelbabu)