Compare commits
2 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
44c9f09e70 | |
|
|
68fc785123 |
|
|
@ -3,8 +3,8 @@ LABEL authors="Vladimir <opa_oz> Levin"
|
||||||
|
|
||||||
RUN curl https://dl.min.io/client/mc/release/linux-amd64/mc \
|
RUN curl https://dl.min.io/client/mc/release/linux-amd64/mc \
|
||||||
--create-dirs \
|
--create-dirs \
|
||||||
-o $HOME/minio-binaries/mc
|
-o /minio-binaries/mc
|
||||||
RUN chmod +x $HOME/minio-binaries/mc
|
RUN chmod +x /minio-binaries/mc
|
||||||
|
|
||||||
COPY entrypoint.sh /entrypoint.sh
|
COPY entrypoint.sh /entrypoint.sh
|
||||||
RUN chmod +x /entrypoint.sh
|
RUN chmod +x /entrypoint.sh
|
||||||
|
|
|
||||||
16
README.md
16
README.md
|
|
@ -4,12 +4,22 @@
|
||||||
|
|
||||||
Runs [minio client](https://min.io/docs/minio/linux/reference/minio-mc.html) to upload file(s) to MinIO (self-hosted as well)
|
Runs [minio client](https://min.io/docs/minio/linux/reference/minio-mc.html) to upload file(s) to MinIO (self-hosted as well)
|
||||||
|
|
||||||
|
## Tricky part
|
||||||
|
_Technically_ this action can be used with different S3-compatible services, but it **needs tuning**
|
||||||
|
|
||||||
|
### MinIO
|
||||||
|
1. You should have a leading slash at the start of `target`
|
||||||
|
2. You should include filename/dirname into `target`. If you have `source=./directory` and `target=/subdir/directory`, it would be nested - `/subdir/directory/directory`
|
||||||
|
|
||||||
|
### Yandex Cloud
|
||||||
|
1. For Ya.Cloud you **have to** include filename/dirname into `target`, otherwise you will get an empty `target`. Example: `source=directory; target=/test` leads to empty `/test`, but `source=directory; target=/test/directory` would upload as expected.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
1. Upload a file
|
1. Upload a file
|
||||||
```yaml
|
```yaml
|
||||||
- name: Upload to MinIO
|
- name: Upload to MinIO
|
||||||
uses: yakubique/minio-upload@v1.1
|
uses: yakubique/minio-upload@v1.1.3
|
||||||
with:
|
with:
|
||||||
endpoint: ${{ secrets.MINIO_ENDPOINT }}
|
endpoint: ${{ secrets.MINIO_ENDPOINT }}
|
||||||
access_key: ${{ secrets.MINIO_ACCESS_KEY }}
|
access_key: ${{ secrets.MINIO_ACCESS_KEY }}
|
||||||
|
|
@ -23,7 +33,7 @@ Runs [minio client](https://min.io/docs/minio/linux/reference/minio-mc.html) to
|
||||||
2. Upload a directory
|
2. Upload a directory
|
||||||
```yaml
|
```yaml
|
||||||
- name: Upload a directory to MinIO
|
- name: Upload a directory to MinIO
|
||||||
uses: yakubique/minio-upload@v1.1
|
uses: yakubique/minio-upload@v1.1.3
|
||||||
with:
|
with:
|
||||||
endpoint: ${{ secrets.MINIO_ENDPOINT }}
|
endpoint: ${{ secrets.MINIO_ENDPOINT }}
|
||||||
access_key: ${{ secrets.MINIO_ACCESS_KEY }}
|
access_key: ${{ secrets.MINIO_ACCESS_KEY }}
|
||||||
|
|
@ -39,7 +49,7 @@ Runs [minio client](https://min.io/docs/minio/linux/reference/minio-mc.html) to
|
||||||
3. Upload to the insecure MinIO instance (_http-only_)
|
3. Upload to the insecure MinIO instance (_http-only_)
|
||||||
```yaml
|
```yaml
|
||||||
- name: Upload to MinIO
|
- name: Upload to MinIO
|
||||||
uses: yakubique/minio-upload@v1.1
|
uses: yakubique/minio-upload@v1.1.3
|
||||||
with:
|
with:
|
||||||
endpoint: ${{ secrets.MINIO_ENDPOINT }}
|
endpoint: ${{ secrets.MINIO_ENDPOINT }}
|
||||||
access_key: ${{ secrets.MINIO_ACCESS_KEY }}
|
access_key: ${{ secrets.MINIO_ACCESS_KEY }}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/sh -l
|
#!/bin/sh -l
|
||||||
|
|
||||||
export PATH=$PATH:$HOME/minio-binaries/
|
export PATH=$PATH:/minio-binaries/
|
||||||
|
|
||||||
insecure_option=""
|
insecure_option=""
|
||||||
if [[ "$YA_INSECURE" == "true" ]]; then
|
if [[ "$YA_INSECURE" == "true" ]]; then
|
||||||
|
|
@ -12,5 +12,5 @@ if [[ "$YA_RECURSIVE" == "true" ]]; then
|
||||||
recursive_option="--recursive"
|
recursive_option="--recursive"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$HOME/minio-binaries/mc alias set ${insecure_option:+"$insecure_option"} target "$YA_ENDPOINT" "$YA_ACCESS_KEY" "$YA_SECRET_KEY"
|
mc alias set ${insecure_option:+"$insecure_option"} target "$YA_ENDPOINT" "$YA_ACCESS_KEY" "$YA_SECRET_KEY"
|
||||||
$HOME/minio-binaries/mc ${insecure_option:+"$insecure_option"} cp ${recursive_option:+"$recursive_option"} $1 "target/$2"
|
mc ${insecure_option:+"$insecure_option"} cp ${recursive_option:+"$recursive_option"} $1 "target/$2"
|
||||||
Loading…
Reference in New Issue