Add an optional insecure option for minio

This commit is contained in:
Haralan Dobrev 2022-08-13 16:41:02 +03:00
parent 3ef78dd641
commit d8b3a5dadb
2 changed files with 11 additions and 1 deletions

View File

@ -22,6 +22,10 @@ inputs:
description: 'Set a target directory for deployment (with a leading slash).'
required: false
default: '/'
insecure:
description: 'Trust SSL certificates with minio --insecure option'
required: false
default: 'false'
runs:
using: 'docker'
image: 'Dockerfile'
@ -29,6 +33,7 @@ runs:
MINIO_ENDPOINT: ${{ inputs.endpoint }}
MINIO_ACCESS_KEY: ${{ inputs.access_key }}
MINIO_SECRET_KEY: ${{ inputs.secret_key }}
MINIO_INSECURE: ${{ inputs.insecure }}
args:
- ${{ inputs.source_dir }}
- '${{ inputs.bucket }}${{ inputs.target_dir }}'

View File

@ -4,4 +4,9 @@ set -euxo pipefail
mc alias set deploy $MINIO_ENDPOINT $MINIO_ACCESS_KEY $MINIO_SECRET_KEY
mc mirror --overwrite $1 "deploy/$2"
insecure_option=""
if ["$MINIO_INSECURE" == "true"]; then
insecure_option="--insecure"
fi
mc mirror --overwrite $insecure_option $1 "deploy/$2"