File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3030
3131 - name : Create test buckets
3232 run : |
33- mc config host add minio1 http://localhost:9000 minio minio123
34- mc config host add minio2 http://localhost:9001 minio minio123
33+ mc admin bucket remote add minio1 http://localhost:9000 minio minio123
34+ mc admin bucket remote add minio2 http://localhost:9001 minio minio123
3535 mc mb minio1/source
3636 mc mb minio2/destination
3737
Original file line number Diff line number Diff line change @@ -7,44 +7,44 @@ RETENTION=${RETENTION:-30d0h0m}
77ADDITIONAL_PARAMETERS=${ADDITIONAL_PARAMETERS:- --quiet}
88
99function pushgateway {
10- if [[ -n " ${PUSHGATEWAY_URL} " ]]; then
11- cat << -EOF | curl --retry 3 --max-time 5 --silent --show-error --data-binary @- "${PUSHGATEWAY_URL} /metrics/job/mirrio/instance/${JOB_NAME} " >/dev/null
10+ if [[ -n " ${PUSHGATEWAY_URL} " ]]; then
11+ cat << -EOF | curl --retry 3 --max-time 5 --silent --show-error --data-binary @- "${PUSHGATEWAY_URL} /metrics/job/mirrio/instance/${JOB_NAME} " >/dev/null
1212 # TYPE mirrio_sync_failed gauge
1313 # HELP mirrio_sync_failed Whether the last sync failed
1414 mirrio_sync_failed $1
1515 EOF
16- fi
16+ fi
1717}
1818
1919function check_env {
20- for var in " $@ " ; do
21- if [[ -z " ${! var} " ]]; then
22- echo " ${var} is not set!"
23- exit 1
24- fi
25- done
20+ for var in " $@ " ; do
21+ if [[ -z " ${! var} " ]]; then
22+ echo " ${var} is not set!"
23+ exit 1
24+ fi
25+ done
2626}
2727
2828function notify {
29- pushgateway 1
30- echo " ERROR: Unable to sync!"
29+ pushgateway 1
30+ echo " ERROR: Unable to sync!"
3131}
3232
3333check_env \
34- SOURCE_URL \
35- SOURCE_ACCESSKEY \
36- SOURCE_SECRETKEY \
37- DESTINATION_URL \
38- DESTINATION_ACCESSKEY \
39- DESTINATION_SECRETKEY \
40- SOURCE_BUCKET \
41- DESTINATION_BUCKET
34+ SOURCE_URL \
35+ SOURCE_ACCESSKEY \
36+ SOURCE_SECRETKEY \
37+ DESTINATION_URL \
38+ DESTINATION_ACCESSKEY \
39+ DESTINATION_SECRETKEY \
40+ SOURCE_BUCKET \
41+ DESTINATION_BUCKET
4242
4343trap notify ERR
4444
45- mc config host add source " ${SOURCE_URL} " " ${SOURCE_ACCESSKEY} " " ${SOURCE_SECRETKEY} " --api S3v4
45+ mc admin bucket remote add source " ${SOURCE_URL} " " ${SOURCE_ACCESSKEY} " " ${SOURCE_SECRETKEY} " --api S3v4
4646
47- mc config host add destination " ${DESTINATION_URL} " " ${DESTINATION_ACCESSKEY} " " ${DESTINATION_SECRETKEY} " --api S3v4
47+ mc admin bucket remote add destination " ${DESTINATION_URL} " " ${DESTINATION_ACCESSKEY} " " ${DESTINATION_SECRETKEY} " --api S3v4
4848
4949mc ls destination | grep -q " ${DESTINATION_BUCKET} " || mc mb " destination/${DESTINATION_BUCKET} "
5050
You can’t perform that action at this time.
0 commit comments