PPA build script source attached

Anything related to PR, release planning and any other non-technical idea how to move the project forward should be discussed here.
Post Reply
maqifrnswa
Posts: 179
Joined: 14 Jan 2013, 03:57

PPA build script source attached

Post by maqifrnswa » 15 Sep 2016, 22:08

Hello all - someone requested the PPA autobuild scripts over the summer. The process is now a hack, it used to be so much easier and automatic, but changes to the system made me do one with cron jobs.

Launchpad is supposed to automatically pull from a repo, then build based on that pull. However, launchpad can't handle submodules:
https://bugs.launchpad.net/bzr-git/+bug/402814

so I get around it by having a cron job pull from github then push to launchpad. Once on launchpad, normal build recipes work.

Code: Select all

#!/bin/bash
date
source $HOME/.keychain/${HOSTNAME}-sh
bzr launchpad-login LOGIN
bzr whoami "name <email@email.com>"
cd /home/labuser/openmw/openmw
git pull origin master
git submodule update --init --recursive
HASH=$(git log --pretty=format:'%h' -n 1)
bzr stat -S|grep ^?|sed 's/^? //'| while read LINE; do bzr add "$LINE"; done
bzr ci -m "Cron update. Git hash: $HASH"
bzr push
Here's our build recipe:
https://code.launchpad.net/~openmw/+recipe/openmw-daily

repository for source code:
https://code.launchpad.net/~openmw/openmw/trunk

For the packaging info, I take bret's packaging directly from debian by the same process and put it on to launchpad (at https://code.launchpad.net/~openmw/open ... packaging2) so the launchpad build can work:

Code: Select all

#!/bin/bash
date
source $HOME/.keychain/${HOSTNAME}-sh
bzr launchpad-login LOGIN
bzr whoami "name <email@email.com>"
cd /home/labuser/openmw.packaging/openmw
git pull 
git submodule update --init --recursive
HASH=$(git log --pretty=format:'%h' -n 1)
bzr stat -S|grep ^?|sed 's/^? //'| while read LINE; do bzr add "$LINE"; done
bzr ci -m "Cron update. Git hash: $HASH"
bzr push
Launchpad can pull from debian directly with no problem, there is just a longer delay than if I do it manually via cron.

I restarted my server, so it should be building again -- but if someone wants to make it more full proof (or build it in to travis/jenkins/some other CI?), that could work too!

User avatar
psi29a
Posts: 3989
Joined: 29 Sep 2011, 10:13
Github profile: https://github.com/psi29a/
Contact:

Re: PPA build script source attached

Post by psi29a » 16 Sep 2016, 13:49

BTW, we don't use git submodules anymore. So can this be automated on launchpad itself?

maqifrnswa
Posts: 179
Joined: 14 Jan 2013, 03:57

Re: PPA build script source attached

Post by maqifrnswa » 16 Sep 2016, 14:48

psi29a wrote:BTW, we don't use git submodules anymore. So can this be automated on launchpad itself?
We'd have to do some surgery on the repo:
https://git.wiki.kernel.org/index.php/G ... al#Removal

i'll give it a shot on my own fork, see if it can work


it's even worse than I thought... you have to rewind to before the submodule was added then recommit everything. https://bugs.launchpad.net/bzr-git/+bug ... omments/69

launchpad supports git now, but mirror isn't turned on yet.

We can look in to other systems too. OpenSUSE's OBS is pretty cool, builds packages and maintains a repo for many distributions at once:
https://build.opensuse.org//
https://en.wikipedia.org/wiki/Open_Build_Service
http://openbuildservice.org
and you can trigger builds using git hooks
http://openbuildservice.org/2013/11/22/ ... Via_Token/

I just haven't used it yet, so don't know if there will be issues. For me, the least effort was the hack in the OP.

EDIT: Putting those repo mirror scripts in to the travis CI commands would probably be the best compromise. When master gets a new commit, test build on travis. If successful, travis pushes the repo to launchpad.
See https://docs.travis-ci.com/user/deployment/custom/

maqifrnswa
Posts: 179
Joined: 14 Jan 2013, 03:57

Re: PPA build script source attached

Post by maqifrnswa » 16 Sep 2016, 15:21

Here we go!
https://docs.travis-ci.com/user/deployment/launchpad/

"Travis CI can get Launchpad to automatically import your code from GitHub after a successful build, which is useful if you are building and hosting Debian packages."

no more need for my server! if anyone wants to tackle this, I think you just need to be added to the openmw team on launchpad.

pull request:
https://github.com/OpenMW/openmw/pull/1064

User avatar
raevol
Posts: 2678
Joined: 07 Aug 2011, 01:12
Location: Caldera

Re: PPA build script source attached

Post by raevol » 16 Sep 2016, 23:12

Ooo! Nice! I may be able to take a look at this later, just got my desktop set up again.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests