Skip to content

Commit

Permalink
Replace rapids-require-env-var w/ set -u (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
ajschmidt8 authored Nov 9, 2022
1 parent 0f5cf5f commit b11d45c
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 41 deletions.
5 changes: 1 addition & 4 deletions tools/rapids-package-name
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
# A utility script that generates a package name from a package type
# Positional Arguments:
# 1) package type
set -eo pipefail
set -euo pipefail
export RAPIDS_SCRIPT_NAME="rapids-package-name"

rapids-require-env-var "RAPIDS_REPOSITORY"
repo_name="${RAPIDS_REPOSITORY##*/}"

if [ -z "$1" ]; then
Expand Down Expand Up @@ -41,7 +40,6 @@ pkg_name="${pkg_type}"

# for conda package types, append CUDA version
if (( append_cuda == 1 )); then
rapids-require-env-var "RAPIDS_CUDA_VERSION"
pkg_name+="_cuda${RAPIDS_CUDA_VERSION%%.*}"
fi

Expand All @@ -52,7 +50,6 @@ fi

# for python package types, add pyver
if (( append_pyver == 1 )); then
rapids-require-env-var "RAPIDS_PY_VERSION"
pkg_name+="_${RAPIDS_PY_VERSION//./}"
fi

Expand Down
21 changes: 0 additions & 21 deletions tools/rapids-require-env-var

This file was deleted.

9 changes: 1 addition & 8 deletions tools/rapids-s3-path
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,10 @@

## For nightly builds:
## s3://rapids-downloads/nightly/<REPO_NAME>/<DATE>/<SHORT_HASH>/
set -eo pipefail
set -euo pipefail
source rapids-constants
export RAPIDS_SCRIPT_NAME="rapids-s3-path"

rapids-require-env-var "RAPIDS_BUILD_TYPE"
rapids-require-env-var "RAPIDS_SHA"
rapids-require-env-var "RAPIDS_REPOSITORY"

repo_name="${RAPIDS_REPOSITORY##*/}"

s3_directory_id=""
Expand All @@ -33,17 +29,14 @@ case "${RAPIDS_BUILD_TYPE}" in
# more info:
# CopyPRs plugin in ops-bot: https://github.com/rapidsai/ops-bot#plugins
# https://circleci.com/blog/triggering-trusted-ci-jobs-on-untrusted-forks/
rapids-require-env-var "RAPIDS_REF_NAME"
s3_directory_id="${RAPIDS_REF_NAME##*/}"
s3_prefix="ci"
;;
branch)
rapids-require-env-var "RAPIDS_REF_NAME"
s3_directory_id="${RAPIDS_REF_NAME}"
s3_prefix="ci"
;;
nightly)
rapids-require-env-var "RAPIDS_NIGHTLY_DATE"
s3_directory_id="${RAPIDS_NIGHTLY_DATE}"
s3_prefix="nightly"
;;
Expand Down
4 changes: 1 addition & 3 deletions tools/rapids-size-checker
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#!/bin/bash
set -e
set -eu
export RAPIDS_SCRIPT_NAME="rapids-size-checker"

rapids-require-env-var "RAPIDS_GH_TOKEN"

echo "Retrieving base branch from GitHub API:"
# For PRs, the branch name is like:
# pull-request/989
Expand Down
3 changes: 1 addition & 2 deletions tools/rapids-upload-conda-to-s3
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Positional Arguments:
# 1) a string of "cpp" or "python" which determines which conda artifact
# should be uploaded
set -eo pipefail
set -euo pipefail

pkg_type="$1"
case "${pkg_type}" in
Expand All @@ -22,7 +22,6 @@ pkg_type="conda_$pkg_type"
pkg_name="$(rapids-package-name "$pkg_type")"

# Where conda build artifacts are output
rapids-require-env-var "RAPIDS_CONDA_BLD_OUTPUT_DIR"
path_to_tar_up="${RAPIDS_CONDA_BLD_OUTPUT_DIR}"

rapids-upload-to-s3 "${pkg_name}" "${path_to_tar_up}"
4 changes: 1 addition & 3 deletions tools/rapids-upload-to-anaconda
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
#!/bin/bash
# A utility script that uploads all the conda packages from a
# GitHub Actions workflow run to Anaconda.org
set -eo pipefail
set -euo pipefail
source rapids-constants
export RAPIDS_SCRIPT_NAME="rapids-upload-to-anaconda"

rapids-require-env-var "RAPIDS_CONDA_TOKEN"

case "${RAPIDS_BUILD_TYPE}" in
branch)
;&
Expand Down

0 comments on commit b11d45c

Please sign in to comment.