Skip to content
Snippets Groups Projects
Commit 2ad6fb55 authored by Rémi PAILHAREY's avatar Rémi PAILHAREY :fork_knife_plate:
Browse files

Merge branch 'feat/add-assets-route' into 'dev'

Feat/add assets route

See merge request web-et-numerique/llle_project/backoffice-client!17
parents 54e782ed c375071c
No related branches found
No related tags found
3 merge requests!24fix(typo): écogestes + optionnel poll,!22feat: Add partners issue info,!17Feat/add assets route
Pipeline #18164 passed
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
/coverage /coverage
# production # production
/build /build
/image-lib
# misc # misc
.DS_Store .DS_Store
/.env /.env
......
...@@ -2,26 +2,20 @@ version: '3.7' ...@@ -2,26 +2,20 @@ version: '3.7'
services: services:
nginx: nginx:
image: nginx:1.16 image: nginx:1.16
depends_on:
- front
- backend
volumes: volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf - ./nginx/nginx.conf:/etc/nginx/nginx.conf
- ./nginx/site.conf:/etc/nginx/conf.d/default.conf - ./nginx/site.conf:/etc/nginx/conf.d/default.conf
- ./cert.pem:/etc/nginx/cert.pem - ./cert.pem:/etc/nginx/cert.pem
- ./key.pem:/etc/nginx/key.pem - ./key.pem:/etc/nginx/key.pem
- ./../${IMAGE_FOLDER}:/usr/share/nginx/html/lib/${IMAGE_FOLDER}
ports: ports:
- 443:443 - 443:443
depends_on: depends_on:
- backend - backend
environment:
- IMAGE_FOLDER=${IMAGE_FOLDER}
# For linux users # For linux users
# extra_hosts: # extra_hosts:
# - "host.docker.internal:host-gateway" # - 'host.docker.internal:host-gateway'
database: database-agent:
image: mysql:5 image: mysql:5
ports: ports:
- 3306:3306 - 3306:3306
...@@ -37,7 +31,7 @@ services: ...@@ -37,7 +31,7 @@ services:
backend: backend:
image: registry.forge.grandlyon.com/web-et-numerique/llle_project/backoffice-server:dev image: registry.forge.grandlyon.com/web-et-numerique/llle_project/backoffice-server:dev
depends_on: depends_on:
database: database-agent:
condition: service_healthy condition: service_healthy
restart: unless-stopped restart: unless-stopped
volumes: volumes:
...@@ -45,7 +39,7 @@ services: ...@@ -45,7 +39,7 @@ services:
- ./configs:/app/configs - ./configs:/app/configs
- ./letsencrypt_cache:/app/letsencrypt_cache - ./letsencrypt_cache:/app/letsencrypt_cache
- ./data:/app/data - ./data:/app/data
- ./../${IMAGE_FOLDER}:/app/${IMAGE_FOLDER} - ./${IMAGE_FOLDER}:/app/${IMAGE_FOLDER}
ports: ports:
- ${HTTPS_PORT}:${HTTPS_PORT} - ${HTTPS_PORT}:${HTTPS_PORT}
- 8090:8090 - 8090:8090
...@@ -63,6 +57,6 @@ services: ...@@ -63,6 +57,6 @@ services:
- DATABASE_USER=${DATABASE_USER} - DATABASE_USER=${DATABASE_USER}
- DATABASE_NAME=${DATABASE_NAME} - DATABASE_NAME=${DATABASE_NAME}
- DATABASE_PASSWORD=${DATABASE_PASSWORD} - DATABASE_PASSWORD=${DATABASE_PASSWORD}
- DATABASE_HOST=database - DATABASE_HOST=database-agent
- MOCK_OAUTH2=${MOCK_OAUTH2} - MOCK_OAUTH2=${MOCK_OAUTH2}
- IMAGE_FOLDER=${IMAGE_FOLDER} - IMAGE_FOLDER=${IMAGE_FOLDER}
...@@ -43,7 +43,7 @@ services: ...@@ -43,7 +43,7 @@ services:
- ./configs:/app/configs - ./configs:/app/configs
- ./letsencrypt_cache:/app/letsencrypt_cache - ./letsencrypt_cache:/app/letsencrypt_cache
- ./data:/app/data - ./data:/app/data
- ./image-lib/${IMAGE_FOLDER}:/app/${IMAGE_FOLDER} - ./${IMAGE_FOLDER}:/app/${IMAGE_FOLDER}
ports: ports:
- ${HTTPS_PORT}:${HTTPS_PORT} - ${HTTPS_PORT}:${HTTPS_PORT}
- 8190:8090 - 8190:8090
......
...@@ -24,10 +24,7 @@ server { ...@@ -24,10 +24,7 @@ server {
location /swagger { location /swagger {
proxy_pass https://backend:1443/swagger; proxy_pass https://backend:1443/swagger;
} }
location ~ ^/assets/(.+\.(?:gif|jpe?g|svg))$ { location /assets {
alias /usr/share/nginx/html/lib/$1; proxy_pass https://backend:1443/assets;
gzip_static on;
expires max;
add_header Cache-Control public;
} }
} }
\ No newline at end of file
#!/bin/bash
# Get env variables
. ../.env
REGISTRY_ID=409
EMAIL_ASSETS_PATH="src/assets/icons/email"
ECOGESTURE_ASSETS_PATH="src/assets/icons/visu/ecogesture"
pwd=$(pwd)
# Fetch and convert email assets
curl "https://forge.grandlyon.com/api/v4/projects/${REGISTRY_ID}/repository/archive?path=${EMAIL_ASSETS_PATH}" --output email.tar.gz
tar -xf email.tar.gz
cd *-email/$EMAIL_ASSETS_PATH && for file in *.svg; do inkscape -h 200 --export-type="png" $file; done && rm *.svg
cd $pwd
# Fetch and convert ecogesture assets
curl "https://forge.grandlyon.com/api/v4/projects/${REGISTRY_ID}/repository/archive?path=${ECOGESTURE_ASSETS_PATH}" --output ecogesture.tar.gz
tar -xf ecogesture.tar.gz
cd *-ecogesture/$ECOGESTURE_ASSETS_PATH && for file in *.svg; do inkscape -h 200 --export-type="png" $file; done && rm *.svg
# Cleanup
cd $pwd
rm -rf ../${IMAGE_FOLDER}/*
# Copy assets in IMAGE_FOLDER
mv *-email/$EMAIL_ASSETS_PATH/* ../${IMAGE_FOLDER}
mv *-ecogesture/$ECOGESTURE_ASSETS_PATH ../${IMAGE_FOLDER}/ecogesture
rm -rf email.tar.gz ecogesture.tar.gz *-email *-ecogesture
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment