Commit f324b744 authored by Noel Alonso's avatar Noel Alonso
Browse files

Merge branch 'dev'

parents f640aebe a8cff7bf
Loading
Loading
Loading
Loading
+4 −24
Original line number Diff line number Diff line
# Template
# Notification manager

| Metrics | Master | Develop |
|:-:|:-:|:-:|
| CI status | [![pipeline status](https://gitlab.com/redmic-project/server/template/badges/master/pipeline.svg)](https://gitlab.com/redmic-project/server/template/commits/master) | [![pipeline status](https://gitlab.com/redmic-project/server/template/badges/dev/pipeline.svg)](https://gitlab.com/redmic-project/server/template/commits/dev) |
| Test coverage | [![coverage report](https://gitlab.com/redmic-project/server/template/badges/master/coverage.svg)](https://gitlab.com/redmic-project/server/template/commits/master) | [![coverage report](https://gitlab.com/redmic-project/server/template/badges/dev/coverage.svg)](https://gitlab.com/redmic-project/server/template/commits/dev) |
| CI status | [![pipeline status](https://gitlab.com/redmic-project/server/notification-manager/badges/master/pipeline.svg)](https://gitlab.com/redmic-project/server/notification-manager/commits/master) | [![pipeline status](https://gitlab.com/redmic-project/server/notification-manager/badges/dev/pipeline.svg)](https://gitlab.com/redmic-project/server/notification-manager/commits/dev) |
| Test coverage | [![coverage report](https://gitlab.com/redmic-project/server/notification-manager/badges/master/coverage.svg)](https://gitlab.com/redmic-project/server/notification-manager/commits/master) | [![coverage report](https://gitlab.com/redmic-project/server/notification-manager/badges/dev/coverage.svg)](https://gitlab.com/redmic-project/server/notification-manager/commits/dev) |

Este proyecto sirve de guía para la creación de un nuevo microservicio.

1. Antes de importar el proyecto, en el fichero `pom.xml`:
	* Reemplazar `template` por el nombre que se le quiere dar al microservicio.
	* Definir la versión de `redmic` (en la sección `parent`) con la más reciente.

2. Importar como proyecto maven.

3. Revisar el resto de ficheros del proyecto, remplazando `template` por el nombre adecuado (incluyendo la primera línea de este mismo fichero).

4. Modificar el puerto del microservicio, reemplazando `port` en los ficheros `deploy/.env` y `src/main/resources/application.properties`.

5. En este último fichero `application.properties`, reemplazar el valor de la propiedad `server.servlet-path` por la ruta deseada (en lugar del valor por defecto `path`).

6. En los ficheros `docker-compose.*.yml`, revisar las redes a las que pertenecerá, la memoria asignada a la pila de Java, añadir volúmenes, etc.

7. Configurar en el fichero `pom.xml` el *spring-boot-starter* adecuado y añadir las dependencias deseadas.

8. En el fichero .gitlab-ci.yml, modificar STACK y SERVICES_TO_CHECK en todos los enviroment, en caso de no querer el valor por defecto, que es el nombre del propio servicio. 

9. Actualizar la tabla inicial de estado, eliminar estas instrucciones y documentar adecuadamente.
Microservicio encargado de manejar las notificaciones.
 No newline at end of file
+2 −2
Original line number Diff line number Diff line
MICROSERVICE_NAME=template
MICROSERVICE_PORT=port
MICROSERVICE_NAME=notification-manager
MICROSERVICE_PORT=8094
+4 −4
Original line number Diff line number Diff line
@@ -12,11 +12,11 @@

	<modelVersion>4.0.0</modelVersion>
	<groupId>es.redmic</groupId>
	<artifactId>template</artifactId>
	<artifactId>notification-manager</artifactId>
	<packaging>jar</packaging>
	<version>x.y.z</version>
	<name>template</name>
	<description>Microservice template</description>
	<version>0.6.0</version>
	<name>Notification manager</name>
	<description>Microservice for send notifications</description>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+4 −4
Original line number Diff line number Diff line
package es.redmic.template;
package es.redmic.notificationmanager;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;

@SpringBootApplication
@ComponentScan({ "es.redmic.template" })
public class TemplateApplication {
@ComponentScan({ "es.redmic.notificationmanager" })
public class NotificationManagerApplication {

	public static void main(String[] args) {
		SpringApplication.run(TemplateApplication.class, args);
		SpringApplication.run(NotificationManagerApplication.class, args);
	}
}
+10 −3
Original line number Diff line number Diff line
server.port=port
server.context-path=/api
server.servlet-path=/path
server.port=8094
server.servlet.context-path=/api
server.servlet.path=/notification

spring.profiles.active=@spring.profiles.active@

info.template.name=@project.name@
info.template.description=@project.description@
info.template.version=@project.version@
info.template.outputEncoding=@project.reporting.outputEncoding@

management.endpoints.web.exposure.include=health, info, prometheus

logging.level.root=info
logging.level.org.springframework=info
logging.level.es.redmic=info