summaryrefslogtreecommitdiffstats
path: root/certService/README.md
blob: 9f23504e54d97a231589055e50c11f9411e99196 (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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# 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/AAF+Certification+Service
    ``` 

### For developers
    * AAF 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/aaf/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.aaf.certservice.aaf-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
or
make build
```   

### Running Docker container local
```
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
```

### Running Docker container from nexus
```
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
```

### Running Docker container from docker-compose with EJBCA
Docker-compose uses a local image of certservice.
Build a docker image locally before run docker compose command.
```
1. Build local image
make build
2. Start Cert Service with configured EJBCA
make start
3. Stop containers
make stop
```
    
### Running with Helm
1. Use environment/server with installed kubernetes and helm.
2. Copy helm/aaf-cert-service directory to that environment.
3. Enter that environment 
4. Run ```helm install ./aaf-cert-service```

### Health Check
Browser:
```
http://<localhost>:8080/actuator/health
```
     
Curl:   
```
curl localhost:8080/actuator/health 
```   
 Should return {"status":"UP"}

### AAF CertService CSITs
#### CSIT repository
```
https://gerrit.onap.org/r/admin/repos/integration/csit
```

####How to run tests locally
1. Checkout CSIT repository
2. Configure CSIT local environment
3. Inside CSIT directory execute
```
sudo ./run-csit.sh plans/aaf/certservice
```

####Jenkins build
https://jenkins.onap.org/view/CSIT/job/aaf-master-csit-certservice/

### Logs locally

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

path:
```
cd /var/log/onap/aaf/certservice
```
You should see:    
audit.log  error.log  trace.log

### Sonar results
```     
https://sonarcloud.io/dashboard?id=onap_aaf-certservice
```
    
### Maven artifacts
All maven artifacts are deployed under nexus uri:
```
https://nexus.onap.org/content/repositories/snapshots/org/onap/aaf/certservice/
```
        
### Docker artifacts
All docker images are hosted under nexus3 uri:
```
https://nexus3.onap.org/repository/docker.snapshot/v2/onap/org.onap.aaf.certservice.aaf-certservice-api/
```

### 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
```

### Sonar results
```     
https://sonarcloud.io/dashboard?id=onap_aaf-certservice
```