From d6c1992e11dd2b0866fa86a802474f1c3073cb27 Mon Sep 17 00:00:00 2001 From: Simon C Date: Mon, 5 Feb 2024 15:05:15 +0100 Subject: [PATCH] feat: Ajout de l'environnement test --- .drone.yml | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/.drone.yml b/.drone.yml index 688f0aa..69dffd9 100644 --- a/.drone.yml +++ b/.drone.yml @@ -34,6 +34,18 @@ kind: secret name: PRODUCTION_AWS_SECRET_ACCESS_KEY data: JX44CwSuvFmYhJCW+vxC4GmUKbO83VyYeImCvIgtkdeC1cRtNEgCA6gWoclT4vSBrk6AW6iQnh3MSpIhOERSn/prcWiTwbBn6YqdUaQ18B9/Dp3Qk1RtOkS2wKI= +--- +# drone encrypt Weko/ceiba-scores $AWS_ACCESS_KEY_ID +kind: secret +name: PRODUCTION_AWS_ACCESS_KEY_ID +data: Bf6VZlmdGQGAOQtwtiOzRCqhnFaW310rw9LqMFVoaQBHiCbso23Zrt6G1N3J0nYGI/oLMhM3 + +--- +# drone encrypt Weko/ceiba-scores $AWS_SECRET_ACCESS_KEY +kind: secret +name: PRODUCTION_AWS_SECRET_ACCESS_KEY +data: kIq0RuZPg2gSamnbei121OHNtupioEYyVay8CnNxNz+u0fEh0c1qnAKM506h+XbwMr+HDyQEUNDM09fqzM14xmRxz8EZtqg6hXVPUcfEIG9nXI9VtnCKMwoKTMQ= + --- kind: pipeline type: docker @@ -123,3 +135,49 @@ volumes: - name: node_modules host: path: /tmp/drone/cache/weko/staging.scores.ceiba-conseil.com/node_modules + +--- +kind: pipeline +type: docker +name: test + +steps: +- name: install npm + image: node:current-alpine + volumes: + - name: node_modules + path: /drone/src/node_modules + commands: + - npm i + - npm run fetchData + - npm run lint + - npm run build + - apk add --no-cache jq + - echo $(cat src/data.json | jq -c '[.[0]]') > src/data.json + +- name: deploy on s3 + image: minio/mc + environment: + AWS_ACCESS_KEY_ID: + from_secret: TEST_AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY: + from_secret: TEST_AWS_SECRET_ACCESS_KEY + commands: + - mc alias set garage https://s3.garage.resilien.cloud $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY --api S3v4 + - mc mirror --overwrite /drone/src/dist garage/test.scores.ceiba-conseil.com + +- name: notify + image: plugins/matrix@sha256:f1affb31b0c86963c97c6f976fa0dcb3cc84272057fd8558d609d28b3064bd7f + settings: + homeserver: https://converser.eu + roomid: "QwOITmkKxRJJyCSDOZ:converser.eu" + userid: "resilien:converser.eu" + accesstoken: + from_secret: MATRIX_ACCESSTOKEN + when: + status: [ failure ] + +volumes: +- name: node_modules + host: + path: /tmp/drone/cache/weko/test.scores.ceiba-conseil.com/node_modules