~canonical-ci-engineering/core-image-watcher/trunk

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
Core Image Watcher
##################

A micro-service that watches for new Ubuntu Core images.

Get the Source
==============

Branch the code::

  $ bzr branch lp:core-image-watcher

Install the Service
========================

Install system dependencies::

  $ sudo apt-get install python3-dev

Build and activate a virtualenv with python3::

  $ virtualenv -p python3 --system-site-packages ve
  $ . ve/bin/activate

Install dependencies from pypi::

  $ pip install -r requirements.txt

...and install some dependencies from phablet-tools PPA::

  $ sudo add-apt-repository ppa:phablet-team/tools
  $ sudo apt-get update
  $ sudo apt-get install ubuntu-device-flash

Install the service itself::

  $ python setup.py install

...you may want to install it in 'development mode', which symlinks files, 
so you can edit/re-run without having to re-install the service. In that 
case, run::

  $ python setup.py develop

Run the tests!
==============

Install dependencies::

  $ pip install -r test_requirements.txt

Run those tests - with vigour!::

  $ python setup.py test

The config file
===============

The sample configuration file in 'core-service.conf'::

   [amqp]
   uris = amqp://guest:guest@localhost:5672//

   [image]
   channel = devel-proposed
   device = generic_amd64
   location = /tmp/latest-core-image-version
   poll_period = 60

   [logstash]
   host = 127.0.0.1
   port = 5959
   version = 1

`logstash` section is optional.