d133e9a3b6a82f59bd71876b3fa3b91f305efb8d
[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 ### Running Locally
17     ```
18      mvn spring-boot:run
19
20     ```
21     
22 ### Running Locally with Developer Tools
23     ```
24      mvn spring-boot:run -Pdev
25
26     ```
27
28 ### Project building
29     ```
30      mvn clean package
31
32     ```
33     
34 ### Building Docker image manually
35 Go to the certService subfolder and execute following statement (1.0.0-SNAPSHOT is related to a current project.version parameter):
36     ```
37     docker build --build-arg VERSION=1.0.0-SNAPSHOT -t onap/org.onap.aaf.certservice.aaf-certservice-api .
38     ```
39     
40 ### Install the package into the local repository
41     ```
42     mvn clean install
43    
44     ```     
45     
46 ### Building Docker image and  install the package into the local repository
47     ```
48     mvn clean install -P docker
49    
50     ```   
51
52 ### Running Docker container local
53     ```
54     docker run -p 8080:8080 --name aaf-certservice-api onap/org.onap.aaf.certservice.aaf-certservice-api
55
56     ```
57
58 ### Running Docker container from nexus
59     ```
60     docker run -p 8080:8080 --name aaf-certservice-api nexus3.onap.org:10001/onap/org.onap.aaf.certservice.aaf-certservice-api:1.0.0
61
62     ```
63     
64 ### Health Check
65  Browser:
66  
67     ```
68      http://<localhost>:8080/actuator/health
69      
70     ```
71      
72  Curl:   
73  
74     ```
75      curl localhost:8080/actuator/health 
76      
77     ```   
78  Should return {"status":"UP"}
79
80 ### Running CSITs
81 Pull csit repository
82     
83     ```
84      https://gerrit.onap.org/r/admin/repos/integration/csit
85     
86     ```
87 Go to created directory and run
88     
89     ```
90      sudo ./run-csit.sh plans/aaf/cert-service
91     
92     ```
93 ### Logs locally
94
95 path: 
96
97     ```
98      var/log/onap/aaf/certservice/
99     ```    
100 ### Logs in Docker container
101     ```
102      docker exec -it aaf-certservice-api bash
103     ```
104
105 path:
106
107     ```
108       cd /var/log/onap/aaf/certservice
109     ```
110 You should see:    
111 audit.log  error.log  trace.log
112
113 ### Sonar results
114     ```     
115       https://sonarcloud.io/dashboard?id=onap_aaf-certservice
116     ```
117     
118  ### Maven artifacts
119  All maven artifacts are deployed under nexus uri:
120      ```
121         https://nexus.onap.org/content/repositories/snapshots/org/onap/aaf/certservice/
122     ```
123         
124  ### Docker artifacts
125  All docker images are hosted under nexus3 uri:
126      ```
127         https://nexus3.onap.org/repository/docker.snapshot/v2/onap/org.onap.aaf.certservice.aaf-certservice-api/
128     ```
129
130 ### RestAPI
131 API is described by Swagger ( OpenAPI 3.0 ) on endpoint /docs 
132 ( endpoint is defined in properties as springdoc.swagger-ui.path )
133   
134     ```
135     http://localchost:8080/docs
136     
137     ```
138
139 ### Sonar results
140     ```     
141       https://sonarcloud.io/dashboard?id=onap_aaf-certservice
142     ```