Skip to content
Snippets Groups Projects
Commit 5d9c4629 authored by FORESTIER Fabien's avatar FORESTIER Fabien
Browse files

Remove deployment job from the CI as it has been moved in a dedicated job

parent ddc6d684
No related branches found
No related tags found
1 merge request!9Update the license
Pipeline #3832 failed
stages:
- sonar-analysis
- build
- deploy
variables:
LEGACY_AUTH_SERVICE_URL: https://download.data.grandlyon.com/auth
ADMIN_USERNAME: data-beta-grandlyon-com
USER_SUPPORT_MAILBOX: alpha-test@erasme.org
ACCESS_TOKEN_COOKIE_KEY: access_token
SONAR_URL: https://sonarqube.forge.grandlyon.com
SONAR_URL: https://sonarqube.forge.grandlyon.com
sonarqube:
stage: sonar-analysis
only:
- development
- 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`
......@@ -33,7 +28,7 @@ build_development:
only:
- development
script:
- export TAG=dev
- export TAG=$CI_COMMIT_SHORT_SHA
- export MIDDLEWARE_LEGACY_SERVICE_BIND_PORT=3004
- export REDIS_SENTINEL_PORT=26379
- export REDIS_SLAVE_PORT=6380
......@@ -41,13 +36,12 @@ build_development:
- 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/337/trigger/pipeline"
build_release:
stage: build
only:
- tags
# except:
# - /^(?!master).+@/
script:
- export TAG=$(echo $CI_COMMIT_TAG | sed 's/v//g')
- export MIDDLEWARE_LEGACY_SERVICE_BIND_PORT=3004
......@@ -56,47 +50,4 @@ build_release:
- export REDIS_MASTER_PORT=6379
- 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 MIDDLEWARE_LEGACY_SERVICE_BIND_PORT=3004
- export REDIS_SENTINEL_PORT=26379
- export REDIS_SLAVE_PORT=6380
- export REDIS_MASTER_PORT=6379
- export SERVICE_EMAIL_URL=http://vm-refonte-data-2:9000/email
- export FRONT_END_URL=https://data-reloaded-dev.alpha.grandlyon.com/fr
- export API_KEY=$DEV_API_KEY
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker-compose pull
- docker-compose --project-name middleware-legacy-auth-${TAG} up -d --force-recreate
environment:
name: development
deploy_staging:
stage: deploy
only:
- development
when: manual
script:
- export TAG=staging
- export MIDDLEWARE_LEGACY_SERVICE_BIND_PORT=3104
- export REDIS_SENTINEL_PORT=26479
- export REDIS_SLAVE_PORT=6480
- export REDIS_MASTER_PORT=6479
- export SERVICE_EMAIL_URL=http://vm-refonte-data-2:9100/email
- export FRONT_END_URL=https://data-reloaded-rec.alpha.grandlyon.com/fr
- export API_KEY=$REC_API_KEY
- 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/middlewares/legacy-auth
- docker tag $CI_REGISTRY/$REGISTRY_PATH:dev $CI_REGISTRY/$REGISTRY_PATH:${TAG}
- docker push $CI_REGISTRY/$REGISTRY_PATH:${TAG}
- docker-compose --project-name middleware-legacy-auth-${TAG} up -d --force-recreate
environment:
name: staging
- docker-compose push
\ No newline at end of file
# Legacy AUTH middleware
## Installation
This middleware 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
......@@ -13,50 +13,50 @@ services:
- SERVICE_EMAIL_URL=${SERVICE_EMAIL_URL}
- USER_SUPPORT_MAILBOX=${USER_SUPPORT_MAILBOX}
- FRONT_END_URL=${FRONT_END_URL}
- VALIDATE_ACCOUNT_URI=connexion
- PASSWORD_RESET_URI=reinitialiser-mon-mot-de-passe
- VALIDATE_ACCOUNT_URI=${VALIDATE_ACCOUNT_URI}
- PASSWORD_RESET_URI=${PASSWORD_RESET_URI}
- API_KEY=${API_KEY}
- ACCESS_TOKEN_COOKIE_KEY=${ACCESS_TOKEN_COOKIE_KEY}
- IMAGE_HOST=https://minio.alpha.grandlyon.com/email-template-assets
- REDIS_SENTINEL_HOST=redis-sentinel-1
- REDIS_SENTINEL_PORT=26379
- REDIS_GROUP_NAME=mymaster
- IMAGE_HOST=${IMAGE_HOST}
- REDIS_SENTINEL_HOST=${REDIS_SENTINEL_HOST}
- REDIS_SENTINEL_PORT=${REDIS_SENTINEL_PORT}
- REDIS_GROUP_NAME=${REDIS_GROUP_NAME}
restart: unless-stopped
depends_on:
- redis-sentinel-1
redis-master:
image: 'bitnami/redis:latest'
image: 'bitnami/redis:5.0.5'
environment:
- ALLOW_EMPTY_PASSWORD=yes
- ALLOW_EMPTY_PASSWORD=${ALLOW_EMPTY_PASSWORD}
ports:
- '${REDIS_MASTER_PORT}:6379'
volumes:
- redis-master:/bitnami/redis/data
restart: unless-stopped
redis-sentinel-1:
image: 'bitnami/redis-sentinel:latest'
redis-sentinel:
image: 'bitnami/redis-sentinel:5.0.5'
environment:
- REDIS_MASTER_HOST=redis-master
- REDIS_MASTER_SET=mymaster
- REDIS_MASTER_HOST=${REDIS_MASTER_HOST}
- REDIS_MASTER_SET=${REDIS_GROUP_NAME}
ports:
- '${REDIS_SENTINEL_PORT}:26379'
volumes:
- redis-sentinel-1:/bitnami/redis/data
restart: unless-stopped
redis-slave-1:
image: 'bitnami/redis:latest'
command: redis-server --bind 0.0.0.0 --slaveof redis-master 6379 --dir /bitnami/redis/data
redis-slave:
image: 'bitnami/redis:5.0.5'
environment:
- ALLOW_EMPTY_PASSWORD=yes
- ALLOW_EMPTY_PASSWORD=${ALLOW_EMPTY_PASSWORD}
ports:
- '${REDIS_SLAVE_PORT}:6379'
command: redis-server --bind 0.0.0.0 --slaveof redis-master 6379 --dir /bitnami/redis/data
volumes:
- redis-slave-1:/bitnami/redis/data
restart: unless-stopped
volumes:
redis-master:
redis-sentinel-1:
redis-slave-1:
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment