Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions utils/publish-rpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,16 @@ func_repo_upload() {
# ${1} - local path
# ${2} - bucket name
# ${3} - COS path
coscli -e "${VAR_COS_ENDPOINT}" rm -r -f "cos://${2}/packages/${3}"
coscli -e "${VAR_COS_ENDPOINT}" rm -r -f "cos://${2}/packages/${3}" || true
coscli -e "${VAR_COS_ENDPOINT}" cp -r "${1}" "cos://${2}/packages/${3}"
}

func_repo_publish() {
# ${1} - CI bucket
# ${2} - repo publish bucket
# ${3} - COS path
coscli -e "${VAR_COS_ENDPOINT}" rm -r -f "cos://${2}/packages/${3}"
coscli -e "${VAR_COS_ENDPOINT}" cp -r "cos://${1}/packages/${3}" "cos://${2}/packages"
coscli -e "${VAR_COS_ENDPOINT}" rm -r -f "cos://${2}/packages/${3}" || true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to make sure it is removed successfully?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently it is not needed, if the folder that needs to be deleted does not exist (e.g. there is no /packages/centos directory in VAR_COS_BUCKET_CI now) then an error will be thrown. The purpose here is to ensure that the directory to be deleted must not exist, either not originally or not after a successful deletion.

coscli -e "${VAR_COS_ENDPOINT}" cp -r "cos://${1}/packages/${3}" "cos://${2}/packages/${3}"
}

# =======================================
Expand Down