d45650997bfb746e8ce67adf346f63b395afeb05
[oom/platform/cert-service.git] / certService / README.md
1 # Cert service
2
3 ### For developers
4     * AAF Cert Service Api is a Spring Boot application
5     * Code style
6         Use Google code formatter in your IDE.
7         For IntelliJ use [https://plugins.jetbrains.com/plugin/8527-google-java-format]
8         For other IDEs use []https://github.com/google/google-java-format]
9
10 ### Running Locally
11     ```
12      mvn spring-boot:run
13
14     ```
15
16 ### Project building
17     ```
18      mvn clean package
19
20     ```
21     
22 ### Building Docker image manually
23     ```
24     docker build -t aaf-certservice-api .
25
26     ```
27     
28 ### Install the package into the local repository
29     ```
30     mvn clean install
31    
32     ```     
33     
34 ### Building Docker image and  install the package into the local repository
35     ```
36     mvn clean install -P docker
37    
38     ```   
39
40 ### Running Docker container local
41     ```
42     docker run -p 8080:8080 --name aaf-certservice-api onap/aaf-certservice-api
43
44     ```
45
46 ### Running Docker container from nexus
47     ```
48     docker run -p 8080:8080 --name aaf-certservice-api nexus3.onap.org:10001/onap/org.onap.aaf.certservice.aaf-certservice-api:1.0.0
49
50     ```
51     
52 ### Health Check
53  Browser:
54  
55     ```
56      http://<localhost>:8080/actuator/health
57      
58     ```
59      
60  Curl:   
61  
62     ```
63      curl localhost:8080/actuator/health 
64      
65     ```   
66  Should return {"status":"UP"}
67
68 ### Running CSITs
69 Pull csit repository
70     
71     ```
72      https://gerrit.onap.org/r/admin/repos/integration/csit
73     
74     ```
75 Go to created directory and run
76     
77     ```
78      sudo ./run-csit.sh plans/aaf/cert-service
79     
80     ```
81 ### Logs locally
82
83 path: 
84
85     ```
86      var/log/onap/aaf/certservice/
87     ```    
88 ### Logs in Docker container
89     ```
90      docker exec -it aaf-certservice-api bash
91     ```
92
93 path:
94
95     ```
96       cd /var/log/onap/aaf/certservice
97     ```
98 You should see:    
99 audit.log  error.log  trace.log
100
101 ### Sonar results
102     ```     
103       https://sonarcloud.io/dashboard?id=onap_aaf-certservice
104     ```
105     
106  ### Maven artifacts
107  All maven artifacts are deployed under nexus uri:
108      ```
109         https://nexus.onap.org/content/repositories/snapshots/org/onap/aaf/certservice/
110     ```
111
112 ### RestAPI
113 API is described by Swagger ( OpenAPI 3.0 ) on endpoint /docs 
114 ( endpoint is defined in properties as springdoc.swagger-ui.path )
115   
116     ```
117     http://localchost:8080/docs
118     
119     ```
120
121 ### Sonar results
122     ```     
123       https://sonarcloud.io/dashboard?id=onap_aaf-certservice
124     ```