Commit b0cf1213 authored by Nicolas CASTEJON's avatar Nicolas CASTEJON
Browse files

Merge branch 'development' into 'master'

Update the license

See merge request !9
parents da747c8e 919f857b
Pipeline #4058 passed with stage
in 18 seconds
stages:
- sonar-analysis
- build
- deploy
variables:
USER_SUPPORT_MAILBOX: alpha-test@erasme.org
SMTP_HOST: mail0.erasme.org
SMTP_PORT: 25
# ADDITIONAL_FEEDBACK_EMAILS:
SONAR_URL: https://sonarqube.forge.grandlyon.com
sonarqube:
stage: sonar-analysis
only:
- master
before_script:
- export PATH=$PATH:/usr/local/bin/sonar-scanner-3.2.0.1227-linux/bin/
- export NODE_PATH=$NODE_PATH:`npm root -g`
script:
- >
sonar-scanner
-Dsonar.projectName=${SONAR_PROJECT_KEY}
-Dsonar.projectVersion=1.0
-Dsonar.sourceEncoding=UTF-8
-Dsonar.projectBaseDir=.
-Dsonar.host.url=${SONAR_URL}
-Dsonar.projectKey=${SONAR_PROJECT_KEY}
-Dsonar.login=${SONAR_TOKEN}
build_development:
stage: build
only:
- development
script:
- export TAG=dev
- export TAG=$CI_COMMIT_SHORT_SHA
- echo ${TAG}
- export MAIL_SERVICE_BIND_PORT=3000
- docker-compose build
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker-compose push
- "curl -X POST -F token=$CI_JOB_TOKEN -F ref=master -F variables[TAG]=${TAG} https://forge.grandlyon.com/api/v4/projects/327/trigger/pipeline"
build_release:
stage: build
only:
- tags
# except:
# - /^(?!master).+@/
script:
- export TAG=$(echo $CI_COMMIT_TAG | sed 's/v//g')
- echo ${TAG}
- export MAIL_SERVICE_BIND_PORT=3000
- docker-compose build
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker-compose push
deploy_development:
stage: deploy
only:
- development
script:
- export TAG=dev
- export MAIL_SERVICE_BIND_PORT=3001
- export MAIL_SUBJECT_PREFIX=alpha
- export NO_REPLY_MAIL_ADDRESS=no-reply@erasme.org
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker-compose pull
- docker-compose --project-name service-email-${TAG} up -d --force-recreate
environment:
name: development
deploy_staging:
stage: deploy
only:
- development
when: manual
script:
- export TAG=staging
- export MAIL_SERVICE_BIND_PORT=3101
- export MAIL_SUBJECT_PREFIX=alpha
- export NO_REPLY_MAIL_ADDRESS=no-reply@erasme.org
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- TAG=dev docker-compose pull
- export REGISTRY_PATH=web-et-numerique/web-et-numerique-internet/data.grandlyon.com/web-portal/components/services/mailer
- docker tag $CI_REGISTRY/$REGISTRY_PATH:dev $CI_REGISTRY/$REGISTRY_PATH:${TAG}
- docker push $CI_REGISTRY/$REGISTRY_PATH:${TAG}
- docker-compose --project-name service-email-${TAG} up -d --force-recreate
environment:
name: staging
\ No newline at end of file
This diff is collapsed.
# Mailer service
## Installation
This service has been developed with the [NestJS](https://nestjs.com/) framework. It requires [Node.js](https://nodejs.org/en/) in order to run.
Once Node.js installed on your computer, you will need to install the project's dependencies. Go to the root of the project and run the following command.
```bash
$ npm install
npm install
```
## Environment variables
......@@ -13,7 +19,7 @@ For a local deployment:
1. `cp template.env .env`
2. Edit .env according to the chosen configuration
The values will be read from the file by default, but you can override any of those by exporting manually the variable before launching the service.
The values will be read from the file by default when running with docker. If you run the service outside of docker you can export those variables.
## Running the app without docker
......@@ -21,26 +27,26 @@ You will need to provide a healthy connection to a database in order for the ser
```bash
# development
$ npm run start
npm run start
# watch mode
$ npm run start:dev
npm run start:dev
# production mode
$ npm run start:prod
npm run start:prod
```
## Running the app with docker
```bash
# build
$ docker-compose build
docker-compose build
# deploy
$ docker-compose up [-d]
docker-compose up [-d]
# build and deploy
$ docker-compose up --build [-d]
docker-compose up --build [-d]
```
<!-- ## Test
......@@ -54,6 +60,4 @@ $ npm run test:e2e
# test coverage
$ npm run test:cov
``` -->
``` -->
\ No newline at end of file
......@@ -3,7 +3,7 @@
"version": "1.2.6",
"description": "description",
"author": "",
"license": "MIT",
"license": "GNU Affero General Public License v3.0",
"scripts": {
"format": "prettier --write \"src/**/*.ts\"",
"start": "ts-node -r tsconfig-paths/register src/main.ts",
......
Markdown is supported
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