Merge pull request #105 from containeroo/renovate/ghcr.io-containeroo… #127
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Test | |
on: | |
push: | |
paths: | |
- mirrio.sh | |
- Dockerfile | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4 | |
- name: Set up Minio | |
run: | | |
docker build -t test/mirrio . | |
docker network create minio | |
docker run -d --network minio -p 9000:9000 -e "MINIO_ACCESS_KEY=minio" -e "MINIO_SECRET_KEY=minio123" --name minio1 minio/minio server /data | |
docker run -d --network minio -p 9001:9000 -e "MINIO_ACCESS_KEY=minio" -e "MINIO_SECRET_KEY=minio123" --name minio2 minio/minio server /data | |
- name: Install Minio Client | |
run: | | |
wget https://dl.min.io/client/mc/release/linux-amd64/mc | |
chmod +x mc | |
sudo mv mc /usr/local/bin/ | |
- name: Create test buckets | |
run: | | |
mc config host add minio1 http://localhost:9000 minio minio123 | |
mc config host add minio2 http://localhost:9001 minio minio123 | |
mc mb minio1/source | |
mc mb minio2/destination | |
- name: Upload test object | |
run: | | |
echo "hello, world!" > test.txt | |
mc cp test.txt minio1/source/ | |
- name: Sync buckets | |
run: | | |
docker ps | |
mc ls minio1/source | |
mc ls minio2/destination | |
docker run \ | |
--network minio \ | |
-e SOURCE_URL=http://minio1:9000 \ | |
-e SOURCE_ACCESSKEY=minio \ | |
-e SOURCE_SECRETKEY=minio123 \ | |
-e DESTINATION_URL=http://minio2:9000 \ | |
-e DESTINATION_ACCESSKEY=minio \ | |
-e DESTINATION_SECRETKEY=minio123 \ | |
-e SOURCE_BUCKET=source \ | |
-e DESTINATION_BUCKET=destination \ | |
test/mirrio |