From 9d353deac4cbdeada20028515817314bfed02f0c Mon Sep 17 00:00:00 2001 From: MatthieuGeerebaert Date: Tue, 15 May 2018 16:25:41 +0200 Subject: Update installation note Change-Id: I802ec6821ed206dde39fc3e4b8e1f68212332639 Issue-ID: EXTAPI-88 Signed-off-by: MatthieuGeerebaert --- docs/installation/installation.rst | 104 ++++++++++++++++++++++++++----------- 1 file changed, 75 insertions(+), 29 deletions(-) (limited to 'docs/installation/installation.rst') diff --git a/docs/installation/installation.rst b/docs/installation/installation.rst index e5473e4..5fce7b8 100644 --- a/docs/installation/installation.rst +++ b/docs/installation/installation.rst @@ -7,50 +7,96 @@ Installation ============ +This document describes local build and installation for development purpose +Build +----- + +Requirements + +* Java 8 +* Maven +* port 8080 should be free, used by tests + +Build +:: + + mvn clean package + +Run +--- + +**Maven** -Environment ------------ +Requirements -**Locally** +* Java 8 +* Maven +* MongoDB +* MariaDB -Ensure that you have a MongoDB and MariaDB instance running and properly -configured in *application.properties* file. -Run *Application.java* class in your favorite IDE +Review and edit *src/main/resources/application.properties* -Or through a terminal, ensure that your maven installation is works and -run *mvn spring-boot:run* command to start the application. +Defaults + Mongo, host=localhost, port=27017, database=ServiceOrderDB + + Mariadb, url=jdbc:mariadb://localhost:3306/nbi, username=root, password=secret + +Run +:: + + mvn spring-boot:run **Docker** -Requirements: `Docker engine `_ and -`docker-compose `_. +Requirements -To start the application: - 1. Generate the application .jar file: `$ mvn clean package` - 2. Configure the **.env** file - 3. Start the *MariaDB* and *MongoDB* services: - `$ docker-compose up -d mongo mariadb` - 4. Build and start the *NBI* service: `$ docker-compose up --build -d nbi` +* Docker +* Docker-compose -You can view the log output of the application with the following command: +Edit *docker-compose.yml* to select previous generated local build, replace:: -`$ docker-compose logs -f nbi` + image: ${NEXUS_DOCKER_REPO}/onap/externalapi/nbi:latest +by:: -Steps ------ + build: . + +Run:: + + docker-compose up -d mongo mariadb + + docker-compose up --build -d nbi + +Logs:: + + docker-compose logs -f nbi + + +Test +---- + +**Healthcheck** + +http://localhost:8080/nbi/api/v1/status + +You should get:: + + { + "name": "nbi", + "status": "ok", + "version": "v1" + } + +**Play with RESTclient** + +You can also test NBI with `VisualStudio RestClient plugin `_ -**Testing** -When the application is running, you can access the API at -:samp:`http://yourhostname:8080/nbi/api/v1/` and fill the URL with the name -of the resources you asking for (/serviceSpecification, /service, -/serviceOrder or /status) -You can run a test by using `VisualStudio RestClient -plugin `_ See the *restclient* package at root level to find *.vscode/settings.json* configuration file and */json/* package with samples requests that can be run. -You can also trigger these endpoints with any RESTful client or -automation framework. + +**Play with Postman** + +A collection is available here *docs/offeredapis/postman* -- cgit 1.2.3-korg