Add init loop in prometheus sidecar container
[osm/devops.git] / descriptor-packages / tools / charm-generator / README.md
1 Charm Generator
2 ===============
3
4 This tool was designed to help bootstrap the process of charm creation.
5 It should help beginners to have a charm working in a matter of minutes.
6
7 The charm generator takes as input an initialized charm and some scripts
8 or description of HTTP requests and transforms it into a functional charm
9 with all the metadata filled in.
10
11 The main flow is the following:
12
13 1) charm create <name of the charm>
14 2) copy the scripts or the requests definition into a specific directory
15 3) run the generator
16 4) charm build
17
18 What types of charms can be generated?
19 --------------------------------------
20
21 Currently, the Charm Generator only supports Ansible scripts.
22
23 In the roadmap, the following charms are planned:
24
25 * HTTP Requests
26 * SOL002 Requests
27 * Python Scripts
28
29 How to run the Charm Generator?
30 -------------------------------
31
32 To run the Charm Generator, you should do the following steps:
33
34 1) Download the OSM Devops git repository
35 2) Install the requirements.txt
36 3) Run the generator.py in the charm that you want to generate
37
38 The only mandatory parameter is what type of charm you want to
39 generate:
40
41 * Ansible (--ansible)
42 * HTTP Requests (--http) - not implemented
43 * SOL002 Requests (--sol002) - not implemented
44 * Python Scripts (--scripts) - not implemented
45
46 There are some recommended parameters, such as:
47
48 * Summary - summary of what the charm does (--summary)
49 * Maintainer - the name and email of the maintainer (--maintainer)
50 * Description - description of what the charm does (--description)
51 * Company - company name to be include in the license headers (--company)
52 * Email - email of the company/developer to be included in the license headers (--email)
53
54 Specifics of the Ansible option
55 -------------------------------
56
57 In order to create an Ansible charm, you need to create a directory
58 inside the charm and name it playbooks. Inside that directory, you 
59 should put all the playbooks that are going to be executed in the charm.
60
61 Note: the playbooks extension must be .yaml
62
63 Your charm should look like this before running the generator:
64
65 ~~~
66 .
67 ├── config.yaml
68 ├── icon.svg
69 ├── layer.yaml
70 ├── metadata.yaml
71 ├── playbooks
72 │   ├── pb-1.yaml
73 │   ├── playbook2.yaml
74 │   └── playbook_3.yaml
75 ├── reactive
76 │   └── testch.py
77 ├── README.ex
78 └── tests
79     ├── 00-setup
80     └── 10-deploy
81 ~~~