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

Merge branch 'development' into 'master'

Update the license

See merge request !2
parents da0ae664 82df000d
Pipeline #4065 passed with stage
in 10 seconds
stages:
- sonar-analysis
- build
- deploy
variables:
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 CSV_CATALOG_DOWNLOAD_SERVICE_BIND_PORT=4000
- export CSV_CATALOG_DOWNLOAD_SERVICE_CACHE_VOLUME=catalog-cache-${TAG}
- export CSV_CATALOG_DOWNLOAD_SERVICE_CONFIG_FILE_PATH=${PWD}/config.yaml
- 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/325/trigger/pipeline"
build_release:
stage: build
......@@ -27,39 +50,3 @@ build_release:
- 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 CSV_CATALOG_DOWNLOAD_SERVICE_BIND_PORT=4040
- export CSV_CATALOG_DOWNLOAD_SERVICE_CACHE_VOLUME=catalog-cache-${TAG}
- docker volume create ${CSV_CATALOG_DOWNLOAD_SERVICE_CACHE_VOLUME}
- export CSV_CATALOG_DOWNLOAD_SERVICE_CONFIG_FILE_PATH=${PWD}/config.yaml
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker-compose pull
- docker-compose --project-name csv-catalog-download-service-${TAG} up -d --force-recreate
environment:
name: development
deploy_staging:
stage: deploy
only:
- development
when: manual
script:
- export TAG=staging
- export CSV_CATALOG_DOWNLOAD_SERVICE_BIND_PORT=4140
- export CSV_CATALOG_DOWNLOAD_SERVICE_CACHE_VOLUME=catalog-cache-${TAG}
- docker volume create ${CSV_CATALOG_DOWNLOAD_SERVICE_CACHE_VOLUME}
- export CSV_CATALOG_DOWNLOAD_SERVICE_CONFIG_FILE_PATH=${PWD}/config.yaml
- 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/csv-catalog-downloader
- docker tag $CI_REGISTRY/$REGISTRY_PATH:dev $CI_REGISTRY/$REGISTRY_PATH:${TAG}
- docker push $CI_REGISTRY/$REGISTRY_PATH:${TAG}
- docker-compose --project-name csv-catalog-download-service-${TAG} up -d --force-recreate
environment:
name: staging
This diff is collapsed.
# Authentication service
## Installation
This service has been developed with the [Flask](https://flask.palletsprojects.com/) framework. It requires [Python](https://www.python.org/) in order to run.
Once Python 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
pip install -r requirements.txt
```
## Environment variables
In order to run the code, some environment variables are needed. They are specified in the `template.env` file at the root of the project.
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 when running with docker. If you run the service outside of docker you can export those variables.
## Running the app without docker
<!-- ############### To be completed ######################-->
## Running the app with docker
```bash
# build
docker-compose build
# deploy
docker-compose up [-d]
# build and deploy
docker-compose up --build [-d]
```
<!-- ## Test
```bash
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
``` -->
\ No newline at end of file
TAG=<version of the service that will be deployed or build>
CSV_CATALOG_DOWNLOAD_SERVICE_BIND_PORT=<port on which the application will be running>
CSV_CATALOG_DOWNLOAD_SERVICE_CACHE_VOLUME=<name of the docker volume to be mounted>
CSV_CATALOG_DOWNLOAD_SERVICE_CONFIG_FILE_PATH=<path to the config file>
\ No newline at end of file
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