-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add rapids-upload-artifacts-dir utility (#43)
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
1 parent
47cb9b6
commit 37f3946
Showing
2 changed files
with
24 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters