8e7fccc4611b66e272f2511a86524cd43e98fb1b
[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/AAF+Certification+Service
7     ``` 
8
9 ### For developers
10     * AAF 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/aaf/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.aaf.certservice.aaf-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 aaf-certservice-api --mount type=bind,source=/<absolute_path>/cmpServers.json,target=/etc/onap/aaf/certservice/cmpServers.json onap/org.onap.aaf.certservice.aaf-certservice-api
56 ```
57
58 ### Running Docker container from nexus
59 ```
60 docker run -p 8080:8080 --name aaf-certservice-api --mount type=bind,source=/<absolute_path>/cmpServers.json,target=/etc/onap/aaf/certservice/cmpServers.json nexus3.onap.org:10001/onap/org.onap.aaf.certservice.aaf-certservice-api:1.0.0
61 ```
62     
63 ### Health Check
64 Browser:
65 ```
66 http://<localhost>:8080/actuator/health
67 ```
68      
69 Curl:   
70 ```
71 curl localhost:8080/actuator/health 
72 ```   
73  Should return {"status":"UP"}
74
75 ### Logs locally
76
77 path: 
78 ```
79 var/log/onap/aaf/certservice/
80 ```    
81 ### Logs in Docker container
82 ```
83 docker exec -it aaf-certservice-api bash
84 ```
85
86 path:
87 ```
88 cd /var/log/onap/aaf/certservice
89 ```
90 You should see:    
91 audit.log  error.log  trace.log
92
93 ### RestAPI
94 API is described by Swagger ( OpenAPI 3.0 ) on endpoint /docs 
95 ( endpoint is defined in properties as springdoc.swagger-ui.path )
96 ```
97 http://localchost:8080/docs
98 ```