-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (50 loc) · 1.75 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
---
name: Test
on:
push:
paths:
- mirrio.sh
- Dockerfile
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # 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