Commit 867dc50d authored by FORESTIER Fabien's avatar FORESTIER Fabien
Browse files

Leave only NODE_ENV var env in gitlab-ci, add endpoint description

parent 743b7d25
Pipeline #2503 passed with stages
in 28 seconds
......@@ -8,9 +8,6 @@ build_development:
- master
script:
- export NODE_ENV=DEV
- export SERVICE_EMAIL_PORT=3001
- export RABBITMQ_STANDARD_PORT=5672
- export RABBITMQ_INTERFACE_PORT=15672
- docker-compose --project-name service-email-dev build
deploy_development:
......@@ -19,9 +16,6 @@ deploy_development:
- master
script:
- export NODE_ENV=DEV
- export SERVICE_EMAIL_PORT=3001
- export RABBITMQ_STANDARD_PORT=5672
- export RABBITMQ_INTERFACE_PORT=15672
- docker-compose --project-name service-email-dev up -d
build_staging:
......@@ -30,9 +24,6 @@ build_staging:
- staging
script:
- export NODE_ENV=REC
- export SERVICE_EMAIL_PORT=3101
- export RABBITMQ_STANDARD_PORT=5673
- export RABBITMQ_INTERFACE_PORT=15673
- sed -i 's/DEV_/REC_/g' docker-compose.yml
- docker-compose --project-name service-email-rec build
......@@ -42,8 +33,5 @@ deploy_staging:
- staging
script:
- export NODE_ENV=REC
- export SERVICE_EMAIL_PORT=3101
- export RABBITMQ_STANDARD_PORT=5673
- export RABBITMQ_INTERFACE_PORT=15673
- sed -i 's/DEV_/REC_/g' docker-compose.yml
- docker-compose --project-name service-email-rec up -d
......@@ -5,7 +5,7 @@ services:
build: .
container_name: service-email-${NODE_ENV}
ports:
- ${SERVICE_EMAIL_PORT}:3000
- ${DEV_SERVICE_EMAIL_PORT}:3000
environment:
- ADMIN_EMAILS=${DEV_ADMIN_EMAILS}
- RABBITMQ_USER=${DEV_RABBITMQ_USER}
......@@ -15,8 +15,8 @@ services:
image: 'rabbitmq:3-management-alpine'
container_name: rabbitmq-${NODE_ENV}
ports:
- ${RABBITMQ_STANDARD_PORT}:5672 # standar port for communication
- ${RABBITMQ_INTERFACE_PORT}:15672 # graphique interface
- ${DEV_RABBITMQ_STANDARD_PORT}:5672 # standar port for communication
- ${DEV_RABBITMQ_INTERFACE_PORT}:15672 # graphique interface
environment:
- RABBITMQ_DEFAULT_USER=${DEV_RABBITMQ_USER}
- RABBITMQ_DEFAULT_PASS=${DEV_RABBITMQ_PASSWORD}
......
import { Controller, Post, Body, Res } from '@nestjs/common';
import { ContactForm } from './email';
import { EmailService } from './email.service';
import { ApiBadRequestResponse, ApiOkResponse, ApiUseTags } from '@nestjs/swagger';
import { ApiBadRequestResponse, ApiOkResponse, ApiUseTags, ApiOperation } from '@nestjs/swagger';
@ApiUseTags('email')
@Controller('email')
......@@ -12,6 +12,7 @@ export class EmailController {
) {}
@Post('contact')
@ApiOperation({ title: 'Send email to admin (emails defined as var env of the project, see docker-compose.yml file).' })
@ApiOkResponse({ description: 'OK'})
@ApiBadRequestResponse({ description: 'Missing fields'})
create(@Body() contactForm: ContactForm, @Res() res) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment