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
- Create a new repository on GitHub
- When the repository has been created you should be able to import code from another repository
- On the next page enter link to openlmis-template-service and press Begin Import
- Go to repository settings and select Collaborators & teams
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.
- Go to Integrations & services in the repository settings
- Add Github plugin with hook url: http://build.openlmis.org/github-webhook/
- Add necessary Jenkins job
- OpenLMIS-{service_name}-contract-test - this job should execute contract tests that will check some areas of the service
- OpenLMIS-{service_name}-deploy-to-test - this job should deploy the newest version of the service to the test server
- In the OpenLMIS-3.x-deploy-to-perftest job add new deploy job to the list in the Upstream Projects to watch property
- OpenLMIS-{service_name}-erd-generation - this job should generate ERD. If the service does not use database this job should not be created.
- OpenLMIS-{service_name}-performance - this job should execute performance tests that will check how fast endpoints are
- OpenLMIS-{service_name}-service - this is the main job, it build the service and create docker container
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.
- Add entries to OpenLMIS servers:
- the Test Server should contain an entry docker-compose.yml that points to the newest SNAPSHOT version of the service
- the UAT Server should contain an entry docker-compose.yml that points to the neweset released version of the service
- the Perftest Server should contain an entry docker-compose.yml that points to the newest SNAPSHOT version of the service
- 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
Add repository toFishEyeIf you do not have permission to do this, ask someone who can add the repository to FishEye.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
OpenLMIS: the global initiative for powerful LMIS software