aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
blob: 0a46e4444390e305dd36a3807571bb823c4a3f34 (plain)
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
76
77
# CHAMELEON

Feeds the Gallifrey time database with entity events

### Building the project

1. mvn clean install
2. mvn package

### Generating a code coverage report

1. mvn clean install
2. mvn exec:java -Dexec.classpathScope=test -Dexec.mainClass='clojure.main' -Dexec.args="--main cloverage.coverage -n 'chameleon.*' -t 'chameleon.testing'"

    2.1. Follow the instructions to view the report.

3. To tweak the report generation, follow the instrustions here:
   https://github.com/cloverage/cloverage

### Developing

1. I use Leiningen for building my clojure project and for dependency
   management. You can read about Leiningen and follow the tutorial at
   the link:
   https://github.com/technomancy/leiningen

2. If you make ** changes to the project.clj file, you are required to
   re-generate the pom.xml by running `lein pom`** (requires leiningen
   to be instaled).

   You can also add your changes to the pom.xml file manually.

3. I use Emacs as my editor and CIDER for interactive development in
   Clojure.
   - CIDER: https://github.com/clojure-emacs/cider
   - Emacs: https://www.gnu.org/software/emacs/

   - Here is a tutorial on Emacs: https://www.gnu.org/software/emacs/tour/
   - Here is the emacs configuration I've used, it includes the CIDER
   package:
   https://github.com/sandhu/emacs.d

4. Start nrepl `C-c M-j` (you have to be in any *.clj file in the
   chameleon project). If the cider-repl buffer doesn't open
   automatically, use `C-x b` and use the arrow keys to find the
   `cider-repl chameleon` buffer and press enter.

5. Open the dev.clj file by `C-x C-f`, load it `C-c C-k` and switch
   your namespace to dev `C-c M-n`.

6. In the repl buffer you should see that the namespace went from `user`
   to `dev`.

7. Make sure the configuration is correct in the dev.clj file and once
   verified, in the repl buffer type `(go)` and press enter.

8. You can verify everthing is running by generating/adding an event
   to dmaap and seeing it flow through chameleon in the error.log file.

### Running it locally (Assumming you're not using Emacs and using
   `lein repl` from the command line)

**Make you're in the directory at the root of your project. Open the
    file `chameleon/dev.clj` and update the config to the correct
    dmaap host, topic, and make sure you're using the correct
    consumer group and id.**

1. On the command line, execute `lein repl`

2. Once in the clojure repl, load the dev namespace
   (load "dev")

3. Go into the dev namespace
   (in-ns 'dev)

4. Run the following command in the repl
   (go)