How to create a new core service

From time to time there is a need to create a new core service. This simple guide shows how create service, add jobs on jenkins and other things that should made when you create a new service.

Step-by-step guide

  1. Create a new repository on GitHub
  2. When the repository has been created you should be able to import code from another repository
  3. On the next page enter link to openlmis-template-service and press Begin Import
  4. Go to repository settings and select Collaborators & teams
  5. Add two teams: Developers and Soldevelo both with write permission level

    Optional

    If you add the Team Leader to Collaborators with Admin permission level, this will allow to make changes in the repository when you will be out of office.

  6. Go to Integrations & services in the repository settings
  7. Add Github plugin with hook url: http://build.openlmis.org/github-webhook/
  8. Add necessary Jenkins job
    1. OpenLMIS-{service_name}-contract-test - this job should execute contract tests that will check some areas of the service
    2. OpenLMIS-{service_name}-deploy-to-test - this job should deploy the newest version of the service to the test server
      1. In the OpenLMIS-3.x-deploy-to-perftest job add new deploy job to the list in the Upstream Projects to watch property
    3. OpenLMIS-{service_name}-erd-generation - this job should generate ERD. If the service does not use database this job should not be created.
    4. OpenLMIS-{service_name}-performance - this job should execute performance tests that will check how fast endpoints are
    5. OpenLMIS-{service_name}-service - this is the main job, it build the service and create docker container
    6. OpenLMIS-{service_name}-service-Sonar - this job should validate the service code with sonar check list. Results can be found on sonar.openlmis.org

      The fastest way to create those jobs is to create a now job based on existing one, for instance you can use reference-data jobs as a template. Be careful you need to change few parameters before you will be able to execute jobs.

  9. Add entries to OpenLMIS servers:
    1. the Test Server should contain an entry docker-compose.yml that points to the newest SNAPSHOT version of the service
    2. the UAT Server should contain an entry docker-compose.yml that points to the neweset released version of the service
    3. the Perftest Server should contain an entry docker-compose.yml that points to the newest SNAPSHOT version of the service
  10. Add entry to OpenLMIS Reference Distribution. The docker-compose.yml should have a new entry that points to the newest SNAPSHOT version of the service
  11. Add repository to FishEye

    If you do not have permission to do this, ask someone who can add the repository to FishEye.

  12. Add docker image to OpenLMIS docker hub

    If you do not have permission to do this, ask someone who can add docker image to the docker hub