Skip to content
mirror_folder_to_s3.yml 819 B
Newer Older
Pierre Ozoux's avatar
Pierre Ozoux committed
variables:
  FOLDER: "public"
  OBJECT_STORE_ENDPOINT: "minio.k7.indie.host"

.deploy:
  stage: deploy
  image:
Pierre Ozoux's avatar
Pierre Ozoux committed
    name: rclone/rclone
Pierre Ozoux's avatar
Pierre Ozoux committed
    entrypoint: [""]
  script:
  - cd ${FOLDER}
  - export AWS_ACCESS_KEY_ID="${AWS_ACCESS_KEY_ID:=$BUCKET}"
Pierre Ozoux's avatar
Pierre Ozoux committed
  - export RCLONE_CONFIG_MINIO_TYPE=s3
  - export RCLONE_CONFIG_MINIO_ENDPOINT=${OBJECT_STORE_ENDPOINT}
  - export RCLONE_CONFIG_MINIO_PROVIDER=Minio
  - export RCLONE_CONFIG_MINIO_ENV_AUTH=true
Pierre Ozoux's avatar
Pierre Ozoux committed
  - rclone copy --ignore-size --ignore-times --progress . minio:$BUCKET
Pierre Ozoux's avatar
Pierre Ozoux committed

deploy-beta:
  extends: .deploy
  rules:
  - if: '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ /^beta/'
  before_script:
  - export BUCKET=beta-${BUCKET}
  - export AWS_SECRET_ACCESS_KEY=${BETA_AWS_SECRET_ACCESS_KEY}

deploy-prod:
  extends: .deploy
Pierre Ozoux's avatar
Pierre Ozoux committed
  rules:
  - if: '$CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'