init commit
This commit is contained in:
5
Dockerfile
Normal file
5
Dockerfile
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
FROM minio/mc:latest
|
||||||
|
|
||||||
|
ADD entrypoint.sh /entrypoint.sh
|
||||||
|
|
||||||
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
26
README.md
Normal file
26
README.md
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
# Minio download GitHub action
|
||||||
|
|
||||||
|
Runs minio client (`mc cp` command) to download files from remote bucket
|
||||||
|
|
||||||
|
# Usage
|
||||||
|
|
||||||
|
Add this action to your `workflow.md`
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- name: 'Minio download'
|
||||||
|
uses: 'ActiveChooN/minio-download-action@v1'
|
||||||
|
with:
|
||||||
|
endpoint: ${{ secrets.ENDPOINT }}
|
||||||
|
access_key: ${{ secrets.ACCESS_KEY }}
|
||||||
|
secret_key: ${{ secrets.SECRET_KEY }}
|
||||||
|
remote_path: 'path/on/remote/bucket'
|
||||||
|
local_path: 'path/on/local/runner'
|
||||||
|
# Optional params:
|
||||||
|
api_version: 'S3v4'
|
||||||
|
bucket: 'bucket_name'
|
||||||
|
args: '--recurcive'
|
||||||
|
```
|
||||||
|
|
||||||
|
# License
|
||||||
|
|
||||||
|
Licensed under the MIT license. See [LICENSE](LICENSE).
|
||||||
43
action.yaml
Normal file
43
action.yaml
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
name: 'Minio download'
|
||||||
|
description: 'Download a file from S3 with Minio CLI'
|
||||||
|
author: 'ActiveChooN'
|
||||||
|
inputs:
|
||||||
|
endpoint:
|
||||||
|
description: 'Endpoint of object storage host'
|
||||||
|
required: true
|
||||||
|
access_key:
|
||||||
|
description: 'Access key'
|
||||||
|
required: true
|
||||||
|
secret_key:
|
||||||
|
description: 'Secret key'
|
||||||
|
required: true
|
||||||
|
remote_path:
|
||||||
|
description: 'Remote path'
|
||||||
|
required: true
|
||||||
|
local_path:
|
||||||
|
description: 'Local path'
|
||||||
|
required: true
|
||||||
|
bucket:
|
||||||
|
description: 'Bucket name'
|
||||||
|
api_version:
|
||||||
|
description: 'API version'
|
||||||
|
default: 'S3v4'
|
||||||
|
args:
|
||||||
|
description: 'Additional args passed to mc command'
|
||||||
|
default: ''
|
||||||
|
runs:
|
||||||
|
using: 'docker'
|
||||||
|
image: 'Dockerfile'
|
||||||
|
env:
|
||||||
|
ENDPOINT: ${{ inputs.endpoint }}
|
||||||
|
ACCESS_KEY: ${{ inputs.access_key }}
|
||||||
|
SECRET_KEY: ${{ inputs.secret_key }}
|
||||||
|
API: ${{ inputs.api }}
|
||||||
|
ARGS: ${{ inputs.args }}
|
||||||
|
BUCKET: ${{ inputs.bucket }}
|
||||||
|
args:
|
||||||
|
- ${{ inputs.remote_path }}
|
||||||
|
- ${{ inputs.local_path }}
|
||||||
|
branding:
|
||||||
|
icon: 'download-cloud'
|
||||||
|
color: 'green'
|
||||||
14
entrypoint.sh
Normal file
14
entrypoint.sh
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/sh -l
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
sh -c "mc alias set action $ENDPOINT $ACCESS_KEY $SECRET_KEY $API"
|
||||||
|
|
||||||
|
FULL_REMOTE_PATH=action
|
||||||
|
|
||||||
|
if [ -n "$BUCKET" ]; then
|
||||||
|
FULL_REMOTE_PATH="$FULL_REMOTE_PATH/$BUCKET"
|
||||||
|
fi
|
||||||
|
|
||||||
|
FULL_REMOTE_PATH="$FULL_REMOTE_PATH/$1"
|
||||||
|
|
||||||
|
sh -c "mc cp $ARGS $FULL_REMOTE_PATH $2"
|
||||||
Reference in New Issue
Block a user