The Mer Wiki now uses your Mer user account and password (create account on https://bugs.merproject.org/)


Nemo/Development

From Mer Wiki
< Nemo
Revision as of 06:59, 10 April 2013 by Zchydem (Talk | contribs)

Jump to: navigation, search

Contents

Automated Packaging from git

Setting up a webhook to github

Open the git tree you have. Go to Settings->Service Hooks->WebHook URLs (Guide at Github)and enter https://webhook.merproject.org/webhook/ to the URL field. Click "Update Settings" and "Test Hook".

NOTE: If you don't see the "Settings" tab as shown here, contact your project admin to give you more rights.

After clicking "Test Hook" the webhooks admin interface will show to the admins that you have active git tree. Now contact on the admins Sage or w00t at #nemomobile IRC channel and they will help you to setup the rest of the webhook process. Here the admin asks you what will be the package name and the target obs project where it should go and saves the information to the webhook admin interface. After this you can check the that the information is valid from https://webhook.merproject.org/webhook/

With tar_git service

tar_git is the service that is used to package packages where nemomobile is the upstream, which means packages that are located at https://github.com/nemomobile/

File structure

With tar_git service packaging information is carried on the same git branch with the code in rpm/ subdirectory. This directory can contain any files which all are exported to packaging in OBS. Usually the content is just plain spec file:

rpm/
  example.spec

If more than one .spec, .yaml or .changes is present the one that matches to the "Package" in webhooks will be taken. This allows one to create multiple packages with same source and different .spec file.

Changelogs

Changelogs are automatically generated from git commit messages, when ever git commit contains line that contains the following format

[sample text] Longer sample text
[feature] New feature X added

it is added automatically to the next changelog entry when new version is tagged. NOTE: Also should be noted that there MUST be at least one commit between each tag that contains a line shown above so that the changelog will be generated properly. Here is example how the lines above would correspond in .changes file

* Mon Apr 08 2013 Developer <developer@developer.dev> - 0.1
- [sample text] Longer sample text
- [feature] New feature X added

NOTE: If you have existing changelog that isn't already in proper format, i.e., git tags and commit messages, you need to add the old .changes file to the rpm/ directory. This .changes file will be is used as a base of the changelog generation and automated changelogs are appended to that. Should be noted that this changes file should not be updated after adding it to the git tree.

Tagging

When ever you do tag on the branch enabled with the webhook, it will automatically launch the tar_git service and the new sources will be downloaded and built on the target project.

Logs/Process

To follow the behaviour of your webhooks you can join to #mer-boss IRC channel @ Freenode. Here is couple of examples of those messages:

< Merbot`> Tag(s) by Developer X in master branch of https://github.com/nemomobile/nemo-qml-plugins.git, which will trigger build in project nemo:devel:mw package nemo-qml-plugins (https://build.merproject.org//package/show?package=nemo-qml-plugins&project=nemo:devel:mw)
< Merbot`> 1 commit(s) pushed by Developer Y to master branch of https://github.com/tswindell/telepathy-ring.git

If you tagged a package you can click the link and check that everything is ok.

Testing rpm package build before committing

To test sources that have tar_git packaging there is tool called mb, this can be installed to Mer Platform SDK and comes in package called sdk-utils. The usage is following:

mb build -t [sb2-target] rpm/my-package.spec

This automatically downloads and installs the dependencies to the sb2 target you specified and then builds and rpm package from the sources within that sb2 target. After this you can move the rpm to the target device and install it and test that everything is ok.

FAQ

Q: I removed a tag remotely and pushed it again, but this didn't trigger the webhook at github?
A: Retag locally and then push again.

With git_pkg service

For packages where Nemo isn't upstream there is plan to use git_pkg instead of tar_git. See https://github.com/lbt/git-pkg for the code. This integration work has not started yet.

Other stuff

This section is a bit of a guide about how to perform unified development on the software that we (in Nemo) write and maintain.

Personal tools