update document
[modeling/etsicatalog.git] / docs / installation.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3
4 Installation
5 ============
6
7 This document describes local build and installation for development purpose.
8
9 Pre-requisites
10 --------------
11
12 * Python3 & pip
13 * MariaDB
14
15 Build & Run
16 -----------
17
18 **Clone repository**:
19 ::
20
21     $ git clone https://gerrit.onap.org/r/modeling/etsicatalog
22     $ cd etsicatalog
23
24 **Create database**::
25
26   $ cd /resources/dbscripts/mysql
27
28 Run modeling-etsicatalog-createdb.sql to create database.
29
30 Run commands followed to init database::
31
32   $ python manage.py makemigrations
33   $ python manage.py makemigrations database
34   $ python manage.py migrate
35   $ python manage.py migrate database
36
37 Review and edit \catalog\pub\config\config.py
38
39 MySQL default configuration is as follows::
40
41     DB_IP = "127.0.0.1"
42     DB_PORT = 3306
43     DB_NAME = "etsicatalog"
44     DB_USER = "etsicatalog"
45     DB_PASSWD = "etsicatalog"
46
47 **Start server**::
48
49   $ python manage.py runserver 8806
50
51
52
53 Test
54 ----
55
56 **Run Healthcheck**::
57
58     GET /api/catalog/v1/health_check
59
60 You should get::
61
62     {
63         "status": "active"
64     }
65
66 **View API document**:
67
68 http://127.0.0.1:8806/api/catalog/v1/swagger
69