Set Python and Ubuntu versions in .readthedocs.yaml
[oom/platform/cert-service.git] / certService / README.md
1 # Cert service
2
3 ### General description
4 More information about the project and all its functionalities you can find under the wiki page: 
5     ```
6     https://wiki.onap.org/display/DW/OOM+Certification+Service
7     ``` 
8
9 ### For developers
10     * OOM Cert Service Api is a Spring Boot application
11     * Code style
12         Use Google code formatter in your IDE.
13         For IntelliJ use [https://plugins.jetbrains.com/plugin/8527-google-java-format]
14         For other IDEs use []https://github.com/google/google-java-format]
15
16 ### Local project configuration
17     * Create directory on your system /etc/onap/oom/certservice
18     * Copy sample configuration test/resources/cmpServers.json to that directory
19
20 ### Running Locally
21 MANDATORY SEE 'Local project configuration' section
22 ```
23 mvn spring-boot:run
24 ```
25   
26 ### Running Locally with Developer Tools
27 MANDATORY SEE 'Local project configuration' section
28 ```
29 mvn spring-boot:run -Pdev
30 ```
31
32 ### Project building
33 ```
34 mvn clean package
35 ```
36     
37 ### Building Docker image manually
38 Go to the certService subfolder and execute following statement (1.0.0-SNAPSHOT is related to a current project.version parameter):
39 ```
40 docker build --build-arg VERSION=1.0.0-SNAPSHOT -t onap/org.onap.oom.certservice.oom-certservice-api .
41 ```
42     
43 ### Install the package into the local repository
44 ```
45 mvn clean install
46 ```     
47     
48 ### Building Docker image and install the package into local repository
49 ```
50 mvn clean install -P docker
51 ```   
52
53 ### Running Docker container local
54 ```
55 docker run -p 8080:8080 --name oom-certservice-api --mount type=bind,source=/<absolute_path>/cmpServers.json,target=/etc/onap/
56 oom/certservice/cmpServers.json onap/org.onap.oom.certservice.oom-certservice-api
57 ```
58
59 ### Running Docker container from nexus
60 ```
61 docker run -p 8080:8080 --name oom-certservice-api --mount type=bind,source=/<absolute_path>/cmpServers.json,target=/etc/onap/oom/certservice/cmpServers.json nexus3.onap.org:10001/onap/org.onap.oom.platform.cert-service.oom-certservice-api:1.0.0
62 ```
63     
64 ### Health Check
65 Browser:
66 ```
67 http://<localhost>:8080/actuator/health
68 ```
69      
70 Curl:   
71 ```
72 curl localhost:8080/actuator/health 
73 ```   
74  Should return {"status":"UP"}
75
76 ### Logs locally
77
78 path: 
79 ```
80 var/log/onap/oom/certservice/
81 ```    
82 ### Logs in Docker container
83 ```
84 docker exec -it oom-certservice-api bash
85 ```
86
87 path:
88 ```
89 cd /var/log/onap/oom/certservice
90 ```
91 You should see:    
92 audit.log  error.log  debug.log
93
94 ### RestAPI
95 API is described by Swagger ( OpenAPI 3.0 ) on endpoint /docs 
96 ( endpoint is defined in properties as springdoc.swagger-ui.path )
97 ```
98 http://localhost:8080/docs
99 ```
100
101 ### OpenAPI
102 during project building yaml file with openAPI 3.0 documentation is generated in target directory with name api-docs.yaml
103 file OpenAPI.yaml located in ./docs/sections/resources directory must be updated be hand if needed