Skip to content

Latest commit

 

History

History
71 lines (55 loc) · 2.67 KB

README.md

File metadata and controls

71 lines (55 loc) · 2.67 KB

Search Component

The search service is based on elasticsearch software to index and retrieve data in the database.

How to implement new code

To implement new features, improvements, or bug fixes, you have to need to start an instance of Elasticsearach.

  • First, you can use the elasticsearch.yml file located in the /src/main/docker folder using this command:
docker compose -f elasticsearch.yml up -d

Note

You can use the .env file in the /src/main/docker folder to set elastic variables (i.e. elastic version, username, or password).

  • Second, use maven command after changing the code.

To clean and install

mvn clean install

or to start the search

mvn spring-boot:run

If there are no errors you can check the search via Swagger APIs at this link:

http://localhost:8080/swagger-ui/index.html#/

Tip

In the Swagger endpoint it's possible to check the current version of the search software.

How to test

To test the new improvements in the code, after creating a new docker image of the search (see details), you can use this command:

docker compose -f search-compose.yml up -d

Note

You can use the .env file in the /src/main/docker folder to set search variables (i.e. search version, log level, or tmforum url).

Check the new changes using the link:

http://localhost:8080/swagger-ui/index.html#/

How to push code in GitHub

Before to push the new code in the GitHub repository, please make the following steps:

  1. upgrade the new version of the software in the pom.xml file.
  2. set the same version above in the .env file for the SEARCH_VERSION variable.
  3. update the release notes file by including the new version and listing features, improvements, bug fixes, etc.
  4. push the code in the main branch to build and test the new software.
  5. align both harbor and dockerhub to create docker images.

Important

It's important to note the version in the pom.xml file can be with or without SNAPSHOT postfix. This postfix will be omitted in the creation of the docker image.

How to create a docker image

To create a new docker image you have to merge your code in the branch:

Tip

The main branch is used to build and test the software.

Warning

The develop branch is used to save and share code in the repository.

Caution

In general, all branches must be aligned with the same code.