Skip to content

Commit

Permalink
Add rapids-upload-artifacts-dir utility (#43)
Browse files Browse the repository at this point in the history
Adds `rapids-upload-artifacts-dir` utility script for uploading
individual files from the `RAPIDS_ARTIFACTS_DIR` directory.

References: rapidsai/shared-workflows#42
rapidsai/cudf#12750

---------

Co-authored-by: AJ Schmidt <[email protected]>
  • Loading branch information
davidwendt and ajschmidt8 authored Feb 18, 2023
1 parent 47cb9b6 commit 37f3946
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
23 changes: 23 additions & 0 deletions tools/rapids-upload-artifacts-dir
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
# A utility that uploads individual files from $RAPIDS_ARTIFACTS_DIR to S3
set -euo pipefail

pkg_prefix="$1"

if [ "${CI:-false}" = "false" ]; then
rapids-echo-stderr "Artifacts from local builds are not uploaded to S3."
exit 0
fi

if [ ! -d "${RAPIDS_ARTIFACTS_DIR}" ]; then
rapids-echo-stderr "Artifacts directory ${RAPIDS_ARTIFACT_DIR} not found."
exit 0
fi

# Upload each file found in RAPIDS_ARTIFACTS_DIR
for art_file in "${RAPIDS_ARTIFACTS_DIR}"/* ; do
[ -e "$art_file" ] || continue
upload_name=$(basename "${art_file}")
pkg_name="${pkg_prefix}.${upload_name}"
rapids-upload-to-s3 "${pkg_name}" "${art_file}"
done
2 changes: 1 addition & 1 deletion tools/rapids-upload-conda-to-s3
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ esac
if [ "${CI:-false}" = "false" ]; then
rapids-echo-stderr "Packages from local builds cannot be uploaded to S3."
rapids-echo-stderr "Open a PR to have successful builds uploaded."
exit 1
exit 0
fi

# Prepend `conda_` to PKG_TYPE
Expand Down

0 comments on commit 37f3946

Please sign in to comment.