Skip to content

Commit 2b7e2f5

Browse files
committed
chore(storage): use rclone replace mc
1 parent 59ef267 commit 2b7e2f5

2 files changed

Lines changed: 15 additions & 9 deletions

File tree

Dockerfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
ARG CODENAME
22
FROM registry.drycc.cc/drycc/base:${CODENAME}
33

4-
ENV DRYCC_UID=1001 \
4+
ARG DRYCC_UID=1001 \
55
DRYCC_GID=1001 \
66
DRYCC_HOME_DIR=/data \
7-
MC_VERSION="2025.08.13.08.35.41" \
87
MINIO_VERSION="2025.09.07.16.13.09"
98

109

1110
RUN groupadd drycc --gid ${DRYCC_GID} \
1211
&& useradd drycc -u ${DRYCC_UID} -g ${DRYCC_GID} -s /bin/bash -m -d ${DRYCC_HOME_DIR} \
13-
&& install-stack mc $MC_VERSION \
1412
&& install-stack minio $MINIO_VERSION \
1513
&& rm -rf \
1614
/usr/share/doc \

_tests/test.sh

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ MINIO_ROOT_PASSWORD=f4c4281665bc11ee8e0400163e04a9cd
66

77
function start-storage {
88
mkdir -p "${BASE_DIR}/data"
9-
podman run --rm -d --name test-storage \
9+
podman run --rm -d --name test-storage \
1010
-e MINIO_PROMETHEUS_AUTH_TYPE=public \
1111
-e MINIO_ROOT_USER=${MINIO_ROOT_USER} \
1212
-e MINIO_ROOT_PASSWORD=${MINIO_ROOT_PASSWORD} \
@@ -30,12 +30,20 @@ function main {
3030
echo -e "\\033[32m---> Waitting for ${S3_IP}:9000\\033[0m"
3131
wait-for-port --host="${S3_IP}" 9000
3232
echo -e "\\033[32m---> S3 service ${S3_IP}:9000 ready...\\033[0m"
33-
# test by minio client
34-
mc --config-dir /tmp/.mc config host add storage "${S3_ENDPOINT}" ${MINIO_ROOT_USER} ${MINIO_ROOT_PASSWORD} --lookup path --api s3v4
35-
mc --config-dir /tmp/.mc mb storage/test
36-
mc --config-dir /tmp/.mc cp "${BASE_DIR}"/test.sh storage/test
33+
# test by rclone client
34+
mkdir -p /tmp/.config/rclone
35+
cat > /tmp/.config/rclone/rclone.conf << EOF
36+
[storage]
37+
type = s3
38+
provider = Other
39+
endpoint = ${S3_ENDPOINT}
40+
access_key_id = ${MINIO_ROOT_USER}
41+
secret_access_key = ${MINIO_ROOT_PASSWORD}
42+
EOF
43+
rclone --config /tmp/.config/rclone/rclone.conf mkdir storage:test
44+
rclone --config /tmp/.config/rclone/rclone.conf copyto "${BASE_DIR}"/test.sh storage:test/test.sh
3745
exit_code=$?
38-
rm -rf /tmp/.mc
46+
rm -rf /tmp/.config/rclone
3947
exit $exit_code
4048
}
4149

0 commit comments

Comments
 (0)