Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Follow the steps below to setup the CPS environment. 

Checkout the

...

project

Checkout https://gerrit.onap.org/r/admin/repos/cps

...

From docker-compose folder run the following after building the images locally :

Code Block
languagebash
docker run -d \
	--name postgres-instance \
	-e POSTGRES_DB=cpsdb \
	-e POSTGRES_USER=cps \
	-e POSTGRES_PASSWORD=cps \
	postgres:13.0

NB. On Linux the IP address of the Docker container (DB_HOST) can be determined using following command
('postgres-instance' is a container name)

...

languagebash

...

VERSION=x.y.z-SNAPSHOT DB_HOST=dbpostgresql DB_USERNAME=cps DB_PASSWORD=cps docker-compose up -d

This starts both cps and postgres containers.

Note: Checkout the README.md in docker-compose folder for detailed steps.

Setup schema in DB

The spring-boot application Liquibase auto creates the schema on startup via a script run by JPA.

Set environment variables with relevant connection details which can be found in application.yamlyml in docker-compose folder.

Building the project

When building the project run from the root cps folder :

Code Block
mvn clean install

Running the project

This option is if you have  a local postgres running.

From the features\the cps \ folder run the following command :

Code Block
java -DDB_HOST=localhost -DDB_USERNAME=cps -DDB_PASSWORD=cps -jar cps-restapplication/target/cps-restapplication-1x.1y.0z-SNAPSHOT.jar

NB. On Linux use IP address of a container instead of localhost

OR 

From the features\the cps\cps-rest application folder run the following command:

...