add Amazon S3 sync script

This commit is contained in:
z4yx 2019-03-28 14:41:55 +08:00
parent f68ddfb7a1
commit e0cb8ec4ee
No known key found for this signature in database
GPG Key ID: 8D451F061C0FF61B
2 changed files with 5 additions and 1 deletions

View File

@ -7,7 +7,7 @@ RUN echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ stretch main contrib n
echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian-security/ stretch/updates main contrib non-free" >> /etc/apt/sources.list
RUN apt-get update && \
apt-get install -y wget curl rsync lftp git jq python-dev python-pip yum-utils createrepo aria2
apt-get install -y wget curl rsync lftp git jq python-dev python-pip yum-utils createrepo aria2 awscli
RUN pip3 install git+https://github.com/tuna/bandersnatch.git@master

4
s3.sh Normal file
View File

@ -0,0 +1,4 @@
#!/bin/bash
[ ! -d "${TUNASYNC_WORKING_DIR}" ] && mkdir -p "${TUNASYNC_WORKING_DIR}"
aws --no-sign-request --endpoint-url="${TUNASYNC_S3_ENDPOINT}" s3 sync "${TUNASYNC_UPSTREAM_URL}" "${TUNASYNC_WORKING_DIR}"