feat: Modification du deploiement

This commit is contained in:
Simon 2022-12-08 12:10:07 +01:00
parent f2acc6b8b3
commit cb1f8b5610
5 changed files with 44 additions and 100 deletions

View File

@ -1,21 +1,3 @@
---
# drone encrypt weko/scores.ceiba-conseil.com $REGISTRY_PASSWORD
kind: secret
name: REGISTRY_PASSWORD
data: BW8D91fKNJuWWF5k5F/CNi8GIQvmNEUocqPJJ+N57qxQ06y+G9q715PBFpys5BTKUQHPQqSd7Q6MhWpsOc5Ttn/gtCX1tbGrAqsFrEec
---
# drone encrypt weko/scores.ceiba-conseil.com $REGISTRY_USER
kind: secret
name: REGISTRY_USER
data: dlboI6U0j0jZxVQiF62p9lQkpFBg7M4QtiD6K7K3NtQmkw==
---
# drone encrypt weko/scores.ceiba-conseil.com "{\"auths\":{\"https://registry.weko.io\":{\"auth\":\"$(echo -n "$REGISTRY_USER:$REGISTRY_PASSWORD" | base64)\",\"email\":\"$REGISTRY_USER\"}}}"
kind: secret
name: REGISTRY_CONFIG
data: B0svjVRqxyDJE+MmSPPCU2hWbBzTjYHS6CnV6IAzGxrQPVNbGmEqoCWkBsG6tUFhL3JcU+fYEidV+RVHTRpYumbDWTXlBSz0q3BVsfqxvgWb2JgpvO7/X3rIxCZwECMMMm7nyRubsOeFDzFh9ic1cU4Bw2DTA+L65lWGiEGME/KqCi6yKy56KjmAC8kAoJ9ifw++KsGytvZjPI68+bbWpRFTAuwWU3SDv12y
---
# drone encrypt weko/scores.ceiba-conseil.com $DIRECTUS_URL
kind: secret
@ -28,6 +10,30 @@ kind: secret
name: DIRECTUS_TOKEN
data: C4N8jh2kDORa5vo2mqOcqbBLLBXdcnHNDq9sK6+R9gzemeyzLp3K7ENw5ZibVYAJ2VEYylQr9zvHFeFE
---
# drone encrypt weko/scores.ceiba-conseil.com $AWS_ACCESS_KEY_ID
kind: secret
name: STAGING_AWS_ACCESS_KEY_ID
data: vlodnMDH4TJTqTBLYgZYq/O5U4IoFl3LGv12aNGRZr39v+tDDaBdB08duY7rXQ3yHnbrXihO
---
# drone encrypt weko/scores.ceiba-conseil.com $AWS_SECRET_ACCESS_KEY
kind: secret
name: STAGING_AWS_SECRET_ACCESS_KEY
data: REEeUiOcy6dtO3fHB5hqZ17aR+YJm3vGkS0tVTdL3Oy32Og+8hFunRZ3Ym7qkrkw8C0JKAhk22traNWEGzPZcb9rzMb25tRRXZC0GdVd+9bvKOMcCYTvBk2hjWI=
---
# drone encrypt weko/scores.ceiba-conseil.com $AWS_ACCESS_KEY_ID
kind: secret
name: PRODUCTION_AWS_ACCESS_KEY_ID
data: hLqwvfjql+mwZ1ES4bLpAHgll1GE5a0Yq6H+MoOwtpxr0PINxDeOWYKI0CNoXtnG3sbWtjlm
---
# drone encrypt weko/scores.ceiba-conseil.com $AWS_SECRET_ACCESS_KEY
kind: secret
name: PRODUCTION_AWS_SECRET_ACCESS_KEY
data: vlXPN/c+WnEMpEbSBPDVCFJFNKy/RIP7oRXW4WsPpv+FhER4lG/1m2dWUPfagHCsdHptN60yfZya3GkZO4DW3lmpfuQGvTu9rkYDZMv2PiWBjX7lyTdmM+oLzIs=
---
kind: pipeline
type: docker
@ -49,20 +55,16 @@ steps:
- npm run lint
- npm run build
- name: push docker image on registry
image: plugins/docker
settings:
username:
from_secret: REGISTRY_USER
password:
from_secret: REGISTRY_PASSWORD
repo: registry.weko.io/scores_ceiba
registry: registry.weko.io
tags:
- latest
image_pull_secrets:
- REGISTRY_CONFIG
- name: deploy on s3
image: minio/mc
environment:
AWS_ACCESS_KEY_ID:
from_secret: PRODUCTION_AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY:
from_secret: PRODUCTION_AWS_SECRET_ACCESS_KEY
commands:
- mc alias set garage http://10.20.20.10:3900 $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY --api S3v4
- mc mirror --overwrite /drone/src/dist garage/scores.ceiba-conseil.com
volumes:
- name: node_modules
@ -90,20 +92,16 @@ steps:
- npm run lint
- npm run build
- name: push docker image on registry
image: plugins/docker
settings:
username:
from_secret: REGISTRY_USER
password:
from_secret: REGISTRY_PASSWORD
repo: registry.weko.io/scores_ceiba
registry: registry.weko.io
tags:
- staging
image_pull_secrets:
- REGISTRY_CONFIG
- name: deploy on s3
image: minio/mc
environment:
AWS_ACCESS_KEY_ID:
from_secret: STAGING_AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY:
from_secret: STAGING_AWS_SECRET_ACCESS_KEY
commands:
- mc alias set garage http://10.20.20.10:3900 $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY --api S3v4
- mc mirror --overwrite /drone/src/dist garage/staging.scores.ceiba-conseil.com
volumes:
- name: node_modules

2
.env
View File

@ -1,2 +0,0 @@
DOCKER_CONTEXT=vert.weko.resilien
URL=scores.ceiba-conseil.com

View File

@ -1,4 +0,0 @@
FROM registry.weko.io/nginx-lowtech:0.0.9
# Copie des sources du site
COPY dist /usr/share/nginx/html

View File

@ -1,28 +0,0 @@
version: "3.8"
volumes:
ceiba-log:
name: ceiba-log
ceiba-stats:
name: ceiba-stats
services:
scores_ceiba-prod:
container_name: ceiba-prod
build: .
image: registry.weko.io/scores_ceiba:latest
restart: always
labels:
traefik.enable: "true"
traefik.http.routers.ceiba.rule: "Host(`${URL}`)"
traefik.http.routers.ceiba.entrypoints: "web"
com.centurylinklabs.watchtower.enable: true
volumes:
- ceiba-log:/var/log/nginx
- ceiba-stats:/usr/share/nginx/html/stats
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
networks:
default:
name: traefik

View File

@ -1,20 +0,0 @@
version: "3.8"
networks:
default:
name: traefik
services:
scores_ceiba-staging:
container_name: ceiba-staging
build: .
image: registry.weko.io/scores_ceiba:staging
restart: always
labels:
traefik.enable: "true"
traefik.http.routers.ceiba-staging.rule: "Host(`staging.${URL}`)"
traefik.http.routers.ceiba-staging.entrypoints: "web"
com.centurylinklabs.watchtower.enable: true
volumes:
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro