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

Merge branch 'dev' into 'master'

Parametriza versiones de imagen de apoyo

See merge request redmic-project/server/notification-manager!2
parents 63fcbac8 fc4d9049
Loading
Loading
Loading
Loading
+13 −9
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@ stages:

maven-build:
  stage: build
  image: registry.gitlab.com/redmic-project/docker/maven
  image: registry.gitlab.com/redmic-project/docker/maven:${MAVEN_IMAGE_TAG}
  variables:
    MAVEN_OPTS: -Dmaven.repo.local=.m2/repository
    SPRING_PROFILES_ACTIVE: test
@@ -78,6 +78,7 @@ docker-tag-already-built-image:
    - tags
  script:
    - docker login -u gitlab-ci-token -p ${CI_JOB_TOKEN} ${CI_REGISTRY}
    - docker pull ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHA}
    - docker tag ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHA} ${CI_REGISTRY_IMAGE}:${CI_COMMIT_TAG}
    - docker push ${CI_REGISTRY_IMAGE}

@@ -109,7 +110,7 @@ container-scanning:

deploy-dev:
  stage: deploy
  image: registry.gitlab.com/redmic-project/docker/docker-deploy
  image: registry.gitlab.com/redmic-project/docker/docker-deploy:${DOCKER_DEPLOY_IMAGE_TAG}
  variables:
    DOCKER_DRIVER: overlay2
    SSH_REMOTE: ${DEV_SSH_REMOTE}
@@ -121,22 +122,23 @@ deploy-dev:
    SPRING_PROFILES_ACTIVE: pre
    SPRING_MAIL_USERNAME: ${SPRING_MAIL_USERNAME}
    SPRING_MAIL_PASSWORD: ${SPRING_MAIL_PASSWORD}
    PUBLIC_HOSTNAME: ${DEV_PUBLIC_HOSTNAME}
  services:
    - docker:dind
  script:
    - >
      deploy.sh IMAGE_NAME=${IMAGE_NAME} IMAGE_TAG=${IMAGE_TAG} COMPOSE_FILE=${COMPOSE_FILE}
      SPRING_PROFILES_ACTIVE=${SPRING_PROFILES_ACTIVE} SPRING_MAIL_USERNAME=${SPRING_MAIL_USERNAME}
      SPRING_MAIL_PASSWORD=${SPRING_MAIL_PASSWORD}
      SPRING_MAIL_PASSWORD=${SPRING_MAIL_PASSWORD} PUBLIC_HOSTNAME=${PUBLIC_HOSTNAME}
  environment:
    name: dev
    url: https://appdev.${DEV_PUBLIC_HOSTNAME}/api/${CI_PROJECT_NAME}
    url: https://${DEV_PUBLIC_HOSTNAME}/api/${CI_PROJECT_NAME}
  only:
    - dev

deploy-supporting-branch:
  stage: deploy
  image: registry.gitlab.com/redmic-project/docker/docker-deploy
  image: registry.gitlab.com/redmic-project/docker/docker-deploy:${DOCKER_DEPLOY_IMAGE_TAG}
  variables:
    DOCKER_DRIVER: overlay2
    SSH_REMOTE: ${DEV_SSH_REMOTE}
@@ -148,16 +150,17 @@ deploy-supporting-branch:
    SPRING_PROFILES_ACTIVE: pre
    SPRING_MAIL_USERNAME: ${SPRING_MAIL_USERNAME}
    SPRING_MAIL_PASSWORD: ${SPRING_MAIL_PASSWORD}
    PUBLIC_HOSTNAME: ${DEV_PUBLIC_HOSTNAME}
  services:
    - docker:dind
  script:
    - >
      deploy.sh IMAGE_NAME=${IMAGE_NAME} IMAGE_TAG=${IMAGE_TAG} COMPOSE_FILE=${COMPOSE_FILE}
      SPRING_PROFILES_ACTIVE=${SPRING_PROFILES_ACTIVE} SPRING_MAIL_USERNAME=${SPRING_MAIL_USERNAME}
      SPRING_MAIL_PASSWORD=${SPRING_MAIL_PASSWORD}
      SPRING_MAIL_PASSWORD=${SPRING_MAIL_PASSWORD} PUBLIC_HOSTNAME=${PUBLIC_HOSTNAME}
  environment:
    name: dev
    url: https://appdev.${DEV_PUBLIC_HOSTNAME}/api/${CI_PROJECT_NAME}
    url: https://${DEV_PUBLIC_HOSTNAME}/api/${CI_PROJECT_NAME}
  only:
    - branches
  except:
@@ -167,7 +170,7 @@ deploy-supporting-branch:

deploy-pro:
  stage: deploy
  image: registry.gitlab.com/redmic-project/docker/docker-deploy
  image: registry.gitlab.com/redmic-project/docker/docker-deploy:${DOCKER_DEPLOY_IMAGE_TAG}
  variables:
    DOCKER_DRIVER: overlay2
    SSH_REMOTE: ${PRO_SSH_REMOTE}
@@ -179,13 +182,14 @@ deploy-pro:
    SPRING_PROFILES_ACTIVE: prod
    SPRING_MAIL_USERNAME: ${SPRING_MAIL_USERNAME}
    SPRING_MAIL_PASSWORD: ${SPRING_MAIL_PASSWORD}
    PUBLIC_HOSTNAME: ${PRO_PUBLIC_HOSTNAME}
  services:
    - docker:dind
  script:
    - >
      deploy.sh IMAGE_NAME=${IMAGE_NAME} IMAGE_TAG=${IMAGE_TAG} COMPOSE_FILE=${COMPOSE_FILE}
      SPRING_PROFILES_ACTIVE=${SPRING_PROFILES_ACTIVE} SPRING_MAIL_USERNAME=${SPRING_MAIL_USERNAME}
      SPRING_MAIL_PASSWORD=${SPRING_MAIL_PASSWORD}
      SPRING_MAIL_PASSWORD=${SPRING_MAIL_PASSWORD} PUBLIC_HOSTNAME=${PUBLIC_HOSTNAME}
  environment:
    name: pro
    url: https://${PRO_PUBLIC_HOSTNAME}/api/${CI_PROJECT_NAME}
+0 −18
Original line number Diff line number Diff line
@@ -6,21 +6,3 @@ services:
      - target: ${MICROSERVICE_PORT}
        published: ${MICROSERVICE_PORT}
        mode: host
    deploy:
      mode: replicated
      replicas: 1
      labels:
        traefik.port: "${MICROSERVICE_PORT}"
        traefik.docker.network: traefik-net
        traefik.frontend.rule: PathPrefix:/api/${MICROSERVICE_NAME}
        traefik.backend: ${MICROSERVICE_NAME}
      restart_policy:
        delay: 1m
        window: 3m
      resources:
        limits:
          cpus: '0.5'
          memory: 512M
        reservations:
          memory: 410M
+0 −16
Original line number Diff line number Diff line
@@ -3,22 +3,6 @@ version: '3.5'
services:
  notification-manager:
    deploy:
      mode: replicated
      replicas: 1
      labels:
        traefik.port: "${MICROSERVICE_PORT}"
        traefik.docker.network: traefik-net
        traefik.frontend.rule: PathPrefix:/api/${MICROSERVICE_NAME}
        traefik.backend: ${MICROSERVICE_NAME}
      placement:
        constraints:
          - node.role == worker
      restart_policy:
        delay: 1m
        window: 3m
      resources:
        limits:
          cpus: '0.5'
          memory: 512M
        reservations:
          memory: 410M
+17 −1
Original line number Diff line number Diff line
@@ -14,11 +14,27 @@ services:
      - traefik-net
      - kafka-net
    healthcheck:
      test: wget --spider -S -t 3 http://localhost:${MICROSERVICE_PORT}/api/notification/actuator/health
      test: wget --spider -q http://localhost:${MICROSERVICE_PORT}/api/notification/actuator/health
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 2m
    deploy:
      mode: replicated
      replicas: 1
      labels:
        traefik.frontend.rule: Host:${PUBLIC_HOSTNAME};PathPrefix:/api/${MICROSERVICE_NAME}
        traefik.backend: ${MICROSERVICE_NAME}
        traefik.port: "${MICROSERVICE_PORT}"
      restart_policy:
        delay: 1m
        window: 3m
      resources:
        limits:
          cpus: '0.5'
          memory: 512M
        reservations:
          memory: 410M

networks:
  traefik-net:
+9 −16
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@
	<parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>2.0.3.RELEASE</version>
		<version>2.1.0.RELEASE</version>
		<relativePath />
	</parent>

@@ -14,7 +14,7 @@
	<groupId>es.redmic</groupId>
	<artifactId>notification-manager</artifactId>
	<packaging>jar</packaging>
	<version>0.6.0</version>
	<version>0.8.0</version>
	<name>Notification manager</name>
	<description>Microservice for send notifications</description>

@@ -27,8 +27,8 @@
		<tomcat.version>8.5.28</tomcat.version>

		<!-- REDMIC -->
		<redmic.broker-lib.version>0.6.0</redmic.broker-lib.version>
		<redmic.test-utils.version>0.6.0</redmic.test-utils.version>
		<redmic.broker-lib.version>0.8.0</redmic.broker-lib.version>
		<redmic.test-utils.version>0.8.0</redmic.test-utils.version>
		<!-- OTHERS -->

		<!-- Plugins -->
@@ -124,18 +124,11 @@
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
				<executions>
					<execution>
						<goals>
							<goal>repackage</goal>
						</goals>
				<configuration>
					<executable>true</executable>
					<finalName>notification-manager</finalName>
					<outputDirectory>dist</outputDirectory>
				</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.jacoco</groupId>
Loading