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


Packaging/webhooks

From Mer Wiki
(Difference between revisions)
Jump to: navigation, search
(Web Interface)
m (syntax error - missing >)
 
Line 42: Line 42:
 
  <services>
 
  <services>
 
   <service name="webhook">
 
   <service name="webhook">
     <param name="repourl">https://github.com/....</param>
+
     <param name="repourl">https://github.com/....blah.git</param>
 
     <param name="branch">master</param>
 
     <param name="branch">master</param>
 
   </service>
 
   </service>

Latest revision as of 11:54, 2 January 2015

Contents

[edit] Webhooks in Mer

Mer uses the OBS as the main project/package management and build system and all source is stored in git repositories.

Webhooks are used to link these systems together as simply as possible.

Each time a tag is pushed to a git repository a notice is sent to the webhook system and the cibot user tells the OBS to rebuild any packages using that git repo.

In practice each package has a webhook service which specifies (at least) the git repository and the branch to be used and the cibot user is granted access to the project.

Some projects are managed by promotions and have webhooks disabled - builds will not be triggered in them.

Webhook activity is reported on the #mer-boss channel on freenode.

[edit] Using Webhooks

Don't forget to enable Webhooks on any git repository you use.

[edit] Command line

There's a helper script called wh which you can find in the Mer sdk-utils package.

You must have a Mer account and have osc setup before you can use the wh utility.

Usages is simple:

   wh <project> <package> <git repo> [<branch>]
 eg
   wh home:lbt:nemo nemopkg http://github.com/lbt/nemopkg.git

If you have write permission to the <package> and/or <project> then everything is setup for you. When it's done you'll get OBS links where you can edit the description too.

[edit] Web Interface

Go to the user tab for the project and add cibot as a maintainer.

Create a package as usual and create a file called _service which contains an XML description of the web hook.

Adjust this XML template to your needs.

 <services>
   <service name="webhook">
     <param name="repourl">https://github.com/....blah.git</param>
     <param name="branch">master</param>
   </service>
 </services>
 

[edit] Typical use cases

[edit] Create a new project/package

From the Mer SDK simply use wh:

wh home:me:work mypkg http://git.merproject.org/me/mypkg.git

Don't forget to enable Webhooks on the git repository

[edit] Copy a package to a personal work area and use a different branch or repo

You can just copy or branch the package - you'll get a webhook automatically. You can then edit the _service file and change the branch or repourl param values.

Branching is useful as it will ensure the same build repositories are used.

From the command line you can use osc to branch the package (to setup the repos you need) and then use the wh command to setup/replace the webhook.

Eg clone https://github.com/nemomobile/dsme.git on github and then, in the SDK run:

osc branch nemo:devel:mw/dsme
wh home:lbt:branches:nemo:devel:mw dsme https://github.com/lbt/dsme.git myfeaturebranch

Any tags pushed to myfeaturebranch on that repo will now build a package in your branch area.

[edit] Promote a package

Just promote as usual.

Maintainers should have added the project to the list of disabled webhook projects so only the git packaging service will run and that will use a fixed commit.

[edit] Delete a package

Just delete the package. Webhooks which reference a deleted package will be deleted periodically.


[edit] Enabling Webhooks on the git repository

[edit] git.merproject.org

  1. Go to your package repository
  2. Click on Settings
  3. Click on Web Hooks
  4. Add https://webhook.merproject.org/webhook/ as the URL
  5. Enable Tag push events

[edit] github.com

  1. Go to your package repository
  2. Click on Settings
  3. Click on Web Hooks & Services
  4. Add https://webhook.merproject.org/webhook/ as the Payload URL
  5. Content type should be application/json
  6. Enable SSL verification
  7. Enable Just the push event
  8. Enable Active

[edit] bitbucket.org

  1. Go to your package repository
  2. Click on Settings
  3. Click on Hooks
  4. Select POST type and Add hook
  5. Add https://webhook.merproject.org/webhook/ as the URL
Personal tools