aboutsummaryrefslogtreecommitdiffstats
path: root/certService/README.md
blob: b7d4fdd68042a90872affda626a3e57e75b338c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# Cert service

### General description
More information about the project and all its functionalities you can find under the wiki page: 
    ```
    https://wiki.onap.org/display/DW/OOM+Certification+Service
    ``` 

### For developers
    * OOM Cert Service Api is a Spring Boot application
    * Code style
        Use Google code formatter in your IDE.
        For IntelliJ use [https://plugins.jetbrains.com/plugin/8527-google-java-format]
        For other IDEs use []https://github.com/google/google-java-format]

### Local project configuration
    * Create directory on your system /etc/onap/oom/certservice
    * Copy sample configuration test/resources/cmpServers.json to that directory

### Running Locally
MANDATORY SEE 'Local project configuration' section
```
mvn spring-boot:run
```
  
### Running Locally with Developer Tools
MANDATORY SEE 'Local project configuration' section
```
mvn spring-boot:run -Pdev
```

### Project building
```
mvn clean package
```
    
### Building Docker image manually
Go to the certService subfolder and execute following statement (1.0.0-SNAPSHOT is related to a current project.version parameter):
```
docker build --build-arg VERSION=1.0.0-SNAPSHOT -t onap/org.onap.oom.certservice.oom-certservice-api .
```
    
### Install the package into the local repository
```
mvn clean install
```     
    
### Building Docker image and install the package into local repository
```
mvn clean install -P docker
```   

### Running Docker container local
```
docker run -p 8080:8080 --name oom-certservice-api --mount type=bind,source=/<absolute_path>/cmpServers.json,target=/etc/onap/
oom/certservice/cmpServers.json onap/org.onap.oom.certservice.oom-certservice-api
```

### Running Docker container from nexus
```
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
```
    
### Health Check
Browser:
```
http://<localhost>:8080/actuator/health
```
     
Curl:   
```
curl localhost:8080/actuator/health 
```   
 Should return {"status":"UP"}

### Logs locally

path: 
```
var/log/onap/oom/certservice/
```    
### Logs in Docker container
```
docker exec -it oom-certservice-api bash
```

path:
```
cd /var/log/onap/oom/certservice
```
You should see:    
audit.log  error.log  debug.log

### RestAPI
API is described by Swagger ( OpenAPI 3.0 ) on endpoint /docs 
( endpoint is defined in properties as springdoc.swagger-ui.path )
```
http://localchost:8080/docs
```

### OpenAPI
during project building yaml file with openAPI 3.0 documentation is generated in target directory with name api-docs.yaml
file OpenAPI.yaml located in certService directory must be update be hand if needed