...
One way to create the database is to adapt by using the docker-compose.yaml
file present on the distribution module.
...
cd ms/blueprintsprocessor/distribution/src/main/dc
Edit it to exclude the blueprints-processor image:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
version: '3.3'
services:
db:
image: mariadb:latest
container_name: ccsdk-mariadb
ports:
- "3306:3306"
volumes:
- ~/vm_mysql:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: sdnctl
MYSQL_DATABASE: sdnctl
MYSQL_USER: sdnctl
MYSQL_PASSWORD: sdnctl
# blueprints-processor:
# depends_on:
# - db
# image: onap/ccsdk-blueprintsprocessor:latest
# container_name: bp-rest
# ports:
# - "8000:8080"
# restart: always
# environment:
# APPLICATIONNAME: BlueprintsProcessor
# BUNDLEVERSION: 1.0.0
# APP_CONFIG_HOME: /opt/app/onap/config
# STICKYSELECTORKEY:
# ENVCONTEXT: dev |
After this, And run docker-composer:
docker-compose up -d db
This should spin up a container of the mariadb MariaDB image in the background. To check if it as has worked, this command can be used:
...
The phrase mysqld: ready for connections
indicates that the database was started correctly.
After this, revert the docker-compose.yaml
file to its original state:
git checkout -- ms/blueprintsprocessor/distribution/src/main/dc/docker-compose.yaml
From now on, the Docker container will be available on the computer; if it ever gets stopped, it can be started again by the command:
...
Execute the following commands to create the needed directories, and to give permissions for grant access to the current user to modify them:
...
mkdir
...
-p
...
-m 755 /opt/app/onap/blueprints/archive
...
mkdir
...
-p
...
-m 755 /opt/app/onap/blueprints/deploy
...
mkdir
...
-p
...
-m 755 /opt/app/onap/scripts
...
sudo chown -R $(id -u):$(id -g) /opt/app/
Import the project on the IDE
...
Navigate to the main class of the Blueprints Processor, the BlueprintProcessorApplication class: cds/ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/cds/blueprintsprocessor/BlueprintProcessorApplication.java
.
Right-click inside it, in at any point, to load the context menu and select create BlueprintProcessorApplication configuration from context:
...