Alicloud: add OSS as upload dest

This commit is contained in:
Xiaoyu Zhong 2019-10-16 21:43:26 +08:00
parent 1208c5ca9f
commit a719e04a6d
2 changed files with 12 additions and 2 deletions

View File

@ -345,6 +345,12 @@ vsphere-version-dist: nodeup-dist protokube-export
upload: version-dist # Upload kops to S3
aws s3 sync --acl public-read ${UPLOAD}/ ${S3_BUCKET}
# oss-upload builds kops and uploads to OSS
.PHONY: oss-upload
oss-upload: version-dist
@echo "== Uploading kops =="
aliyun oss cp --acl public-read -r -f --include "*" ${UPLOAD}/ ${OSS_BUCKET}
# gcs-upload builds kops and uploads to GCS
.PHONY: gcs-upload
gcs-upload: bazel-version-dist

View File

@ -23,6 +23,10 @@ if [[ "${DEST:0:5}" == "gs://" ]]; then
exit 0
fi
echo "Unsupported destination - supports s3:// and gs:// urls: ${DEST}"
exit 1
if [[ "${DEST:0:6}" == "oss://" ]]; then
aliyun oss cp --acl public-read -r -f --include "*" ${SRC}/ ${DEST}
exit 0
fi
echo "Unsupported destination - supports s3://, gs:// and oss:// urls: ${DEST}"
exit 1