From 28ba4ed4a0877b84e1425d76eda5e8af70a999dd Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Wed, 19 Jul 2023 16:04:30 +0200 Subject: [PATCH] Feat: use tmp volumes --- .drone.yml | 52 ++++++++++++++++++++++++++++++++++------------------ 1 file changed, 34 insertions(+), 18 deletions(-) diff --git a/.drone.yml b/.drone.yml index 3b92ed9..52133db 100644 --- a/.drone.yml +++ b/.drone.yml @@ -12,14 +12,18 @@ workspace: steps: - name: Clean before push image: alpine + volumes: + - name: tosend + path: /tosend commands: - - rm -r tools/ .git - - find . -type f -name "*.tex" -delete - - find . -type f -name "*.rst" -delete - - rm .drone.yml .gitignore .pre-commit-config.yaml .rstcheck.cfg + - apk add --no-cache rsync + - rsync -am --include="*/" --include="*.odt" --include="*.pdf" --exclude="*" ./ /tosend - name: Push bucket Raw image: plugins/s3-sync:1 + volumes: + - name: tosend + path: /tosend settings: bucket: raw endpoint: https://storage.opytex.org @@ -49,30 +53,36 @@ steps: - name: Build Opytex 2022-2023 image: python:3.8-alpine + volumes: + - name: pelican-output + path: /output commands: - - apk add --no-cache git imagemagick-dev imagemagick - - cd .. - - git init . - - git remote add origin https://git.opytex.org/lafrite/site_opytex.git - - git pull origin 2022-2023 - - git checkout 2022-2023 - - git submodule init - - git submodule update - - pip install --no-cache-dir -r requirements.txt - - export MAGICK_HOME=/usr - - pelican content/ -o output -s publishconf.py --relative-urls + - apk add --no-cache git imagemagick-dev imagemagick + - cd .. + - git init . + - git remote add origin https://git.opytex.org/lafrite/site_opytex.git + - git pull origin 2022-2023 + - git checkout 2022-2023 + - git submodule init + - git submodule update + - pip install --no-cache-dir -r requirements.txt + - export MAGICK_HOME=/usr + - pelican /drone/content/ -o /output -s publishconf.py --relative-urls - name: Push to bucket opytex.org image: plugins/s3-sync:1 + volumes: + - name: pelican-output + path: /drone/content/output settings: - bucket: raw + bucket: opytex.org endpoint: https://storage.opytex.org access_key: from_secret: minio_access_key secret_key: from_secret: minio_secret_key - source: output - target: /2022-2023 + source: /output + target: /enseignements/2022-2023 path_style: true delete: true @@ -87,3 +97,9 @@ steps: # SSH_KEY: # from_secret: sshcontent-key # + +volumes: + - name: tosend + temp: {} + - name: pelican-output + temp: {}