From cc00b2bcf22a9fb04ea7b7c9ffe339cf1c0af494 Mon Sep 17 00:00:00 2001 From: Jake Awe Date: Wed, 30 Oct 2024 09:34:19 -0500 Subject: [PATCH] refactor cleanup --- ci/upload_cudf_java_docs.sh | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/ci/upload_cudf_java_docs.sh b/ci/upload_cudf_java_docs.sh index 44ae752f999..88f12721db1 100755 --- a/ci/upload_cudf_java_docs.sh +++ b/ci/upload_cudf_java_docs.sh @@ -11,13 +11,7 @@ validate_version() { fi } -cleanup() { - rm -rf cudf-*-javadoc.jar cudf-docs 2>/dev/null || true -} - main() { - trap cleanup EXIT - if [ $# -ne 1 ]; then echo "Usage: $0 " echo "Version format: YY.MM or YY.MM.P" @@ -37,9 +31,11 @@ main() { local url="https://repo1.maven.org/maven2/ai/rapids/cudf/${major}.${minor}.${patch}/cudf-${major}.${minor}.${patch}-javadoc.jar" - wget "$url" - unzip cudf-*-javadoc.jar -d cudf-docs - aws s3 sync --delete cudf-docs/ "s3://rapidsai-docs/cudf-java/html/${DOCS_VERSION}/" + TMP_FILE=$(mktemp) + TMP_DIR=$(mktemp -d) + wget -O "${TMP_FILE}" "$url" + unzip "${TMP_FILE}" -d "${TMP_DIR}" + aws s3 sync --delete "${TMP_DIR}"/ "s3://rapidsai-docs/cudf-java/html/${DOCS_VERSION}/" echo "Documentation successfully uploaded to s3://rapidsai-docs/cudf-java/html/${DOCS_VERSION}/" }