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
1 merge request!9Update the license
Pipeline #3832 failed
stages: stages:
- sonar-analysis - sonar-analysis
- build - build
- deploy
variables: variables:
LEGACY_AUTH_SERVICE_URL: https://download.data.grandlyon.com/auth SONAR_URL: https://sonarqube.forge.grandlyon.com
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
sonarqube: sonarqube:
stage: sonar-analysis stage: sonar-analysis
only: only:
- development - master
before_script: before_script:
- export PATH=$PATH:/usr/local/bin/sonar-scanner-3.2.0.1227-linux/bin/ - export PATH=$PATH:/usr/local/bin/sonar-scanner-3.2.0.1227-linux/bin/
- export NODE_PATH=$NODE_PATH:`npm root -g` - export NODE_PATH=$NODE_PATH:`npm root -g`
...@@ -33,7 +28,7 @@ build_development: ...@@ -33,7 +28,7 @@ build_development:
only: only:
- development - development
script: script:
- export TAG=dev - export TAG=$CI_COMMIT_SHORT_SHA
- export MIDDLEWARE_LEGACY_SERVICE_BIND_PORT=3004 - export MIDDLEWARE_LEGACY_SERVICE_BIND_PORT=3004
- export REDIS_SENTINEL_PORT=26379 - export REDIS_SENTINEL_PORT=26379
- export REDIS_SLAVE_PORT=6380 - export REDIS_SLAVE_PORT=6380
...@@ -41,13 +36,12 @@ build_development: ...@@ -41,13 +36,12 @@ build_development:
- docker-compose build - docker-compose build
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker-compose push - 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: build_release:
stage: build stage: build
only: only:
- tags - tags
# except:
# - /^(?!master).+@/
script: script:
- export TAG=$(echo $CI_COMMIT_TAG | sed 's/v//g') - export TAG=$(echo $CI_COMMIT_TAG | sed 's/v//g')
- export MIDDLEWARE_LEGACY_SERVICE_BIND_PORT=3004 - export MIDDLEWARE_LEGACY_SERVICE_BIND_PORT=3004
...@@ -56,47 +50,4 @@ build_release: ...@@ -56,47 +50,4 @@ build_release:
- export REDIS_MASTER_PORT=6379 - export REDIS_MASTER_PORT=6379
- docker-compose build - docker-compose build
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker-compose push - docker-compose push
\ No newline at end of file
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
# Legacy AUTH middleware
## Installation ## 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 ```bash
$ npm install npm install
``` ```
## Environment variables ## Environment variables
...@@ -13,7 +19,7 @@ For a local deployment: ...@@ -13,7 +19,7 @@ For a local deployment:
1. `cp template.env .env` 1. `cp template.env .env`
2. Edit .env according to the chosen configuration 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 ## 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 ...@@ -21,26 +27,26 @@ You will need to provide a healthy connection to a database in order for the ser
```bash ```bash
# development # development
$ npm run start npm run start
# watch mode # watch mode
$ npm run start:dev npm run start:dev
# production mode # production mode
$ npm run start:prod npm run start:prod
``` ```
## Running the app with docker ## Running the app with docker
```bash ```bash
# build # build
$ docker-compose build docker-compose build
# deploy # deploy
$ docker-compose up [-d] docker-compose up [-d]
# build and deploy # build and deploy
$ docker-compose up --build [-d] docker-compose up --build [-d]
``` ```
<!-- ## Test <!-- ## Test
...@@ -54,6 +60,4 @@ $ npm run test:e2e ...@@ -54,6 +60,4 @@ $ npm run test:e2e
# test coverage # test coverage
$ npm run test:cov $ npm run test:cov
``` --> ``` -->
\ No newline at end of file
...@@ -13,50 +13,50 @@ services: ...@@ -13,50 +13,50 @@ services:
- SERVICE_EMAIL_URL=${SERVICE_EMAIL_URL} - SERVICE_EMAIL_URL=${SERVICE_EMAIL_URL}
- USER_SUPPORT_MAILBOX=${USER_SUPPORT_MAILBOX} - USER_SUPPORT_MAILBOX=${USER_SUPPORT_MAILBOX}
- FRONT_END_URL=${FRONT_END_URL} - FRONT_END_URL=${FRONT_END_URL}
- VALIDATE_ACCOUNT_URI=connexion - VALIDATE_ACCOUNT_URI=${VALIDATE_ACCOUNT_URI}
- PASSWORD_RESET_URI=reinitialiser-mon-mot-de-passe - PASSWORD_RESET_URI=${PASSWORD_RESET_URI}
- API_KEY=${API_KEY} - API_KEY=${API_KEY}
- ACCESS_TOKEN_COOKIE_KEY=${ACCESS_TOKEN_COOKIE_KEY} - ACCESS_TOKEN_COOKIE_KEY=${ACCESS_TOKEN_COOKIE_KEY}
- IMAGE_HOST=https://minio.alpha.grandlyon.com/email-template-assets - IMAGE_HOST=${IMAGE_HOST}
- REDIS_SENTINEL_HOST=redis-sentinel-1 - REDIS_SENTINEL_HOST=${REDIS_SENTINEL_HOST}
- REDIS_SENTINEL_PORT=26379 - REDIS_SENTINEL_PORT=${REDIS_SENTINEL_PORT}
- REDIS_GROUP_NAME=mymaster - REDIS_GROUP_NAME=${REDIS_GROUP_NAME}
restart: unless-stopped restart: unless-stopped
depends_on: depends_on:
- redis-sentinel-1 - redis-sentinel-1
redis-master: redis-master:
image: 'bitnami/redis:latest' image: 'bitnami/redis:5.0.5'
environment: environment:
- ALLOW_EMPTY_PASSWORD=yes - ALLOW_EMPTY_PASSWORD=${ALLOW_EMPTY_PASSWORD}
ports: ports:
- '${REDIS_MASTER_PORT}:6379' - '${REDIS_MASTER_PORT}:6379'
volumes: volumes:
- redis-master:/bitnami/redis/data - redis-master:/bitnami/redis/data
restart: unless-stopped
redis-sentinel-1: redis-sentinel:
image: 'bitnami/redis-sentinel:latest' image: 'bitnami/redis-sentinel:5.0.5'
environment: environment:
- REDIS_MASTER_HOST=redis-master - REDIS_MASTER_HOST=${REDIS_MASTER_HOST}
- REDIS_MASTER_SET=mymaster - REDIS_MASTER_SET=${REDIS_GROUP_NAME}
ports: ports:
- '${REDIS_SENTINEL_PORT}:26379' - '${REDIS_SENTINEL_PORT}:26379'
volumes: restart: unless-stopped
- redis-sentinel-1:/bitnami/redis/data
redis-slave-1: redis-slave:
image: 'bitnami/redis:latest' image: 'bitnami/redis:5.0.5'
command: redis-server --bind 0.0.0.0 --slaveof redis-master 6379 --dir /bitnami/redis/data
environment: environment:
- ALLOW_EMPTY_PASSWORD=yes - ALLOW_EMPTY_PASSWORD=${ALLOW_EMPTY_PASSWORD}
ports: ports:
- '${REDIS_SLAVE_PORT}:6379' - '${REDIS_SLAVE_PORT}:6379'
command: redis-server --bind 0.0.0.0 --slaveof redis-master 6379 --dir /bitnami/redis/data
volumes: volumes:
- redis-slave-1:/bitnami/redis/data - redis-slave-1:/bitnami/redis/data
restart: unless-stopped
volumes: volumes:
redis-master: redis-master:
redis-sentinel-1:
redis-slave-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