Skip to content

Commit

Permalink
Catch curl uploading error when upload fails
Browse files Browse the repository at this point in the history
Signed-off-by: Sunnatillo <sunnat.samadov@est.tech>
  • Loading branch information
Sunnatillo committed Nov 5, 2024
1 parent 8103e5a commit bb62087
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion jenkins/image_building/upload-node-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ rt_delete_artifact() {
rt_upload_artifact() {
local src_path="${1:?}"
local dst_path="${2:?}"
curl -s -XPUT -u"${RT_USER:?}:${RT_TOKEN:?}" "${RT_URL}/${dst_path}" -T "${src_path}"
curl -s --fail-with-body -XPUT -u"${RT_USER:?}:${RT_TOKEN:?}" "${RT_URL}/${dst_path}" -T "${src_path}"
}

rt_list_directory() {
Expand Down
1 change: 1 addition & 0 deletions jenkins/scripts/artifactory/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ rt_upload_artifact() {
ANONYMOUS="${3:-1}"

_CMD="curl \
--fail-with-body \
$( ([[ "${ANONYMOUS}" != 1 ]] && echo " -u${RT_USER:?}:${RT_TOKEN:?}") || true) \
${RT_URL}/${DST_PATH} \
-T ${SRC_PATH}"
Expand Down

0 comments on commit bb62087

Please sign in to comment.