Skip to content

Commit

Permalink
Dell ECS cleanup now on partition
Browse files Browse the repository at this point in the history
  • Loading branch information
Zejnilovic authored Mar 22, 2024
1 parent db76241 commit ba01fab
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions scripts/bash/s3a_wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ shift
hdfsPublishPath=""
hdfsPath=""
jceks_flag=""
std_path="$STD_HDFS_PATH"

# Function to print error message and exit
function error_exit() {
Expand Down Expand Up @@ -105,6 +106,18 @@ function cleanup_versions() {
return 0
}

# Function to get evaluated tmp path for standardization
# Replace placeholders if present
function replace_std_path_placeholders() {
std_path=$(echo "$path" | sed "s/{0}/$dataset_name/")
std_path=$(echo "$path" | sed "s/{1}/$dataset_version/")
std_path=$(echo "$path" | sed "s/{2}/$report_date/")
std_path=$(echo "$path" | sed "s/{3}/$report_version/")

return 0
}


# Parse command line arguments
while [[ $# -gt 0 ]]; do
case "$1" in
Expand Down Expand Up @@ -152,7 +165,7 @@ echo "$original_script" "${other_args[@]}" \
exit_code=$?

# Clean up versions if necessary
[[ $hdfsPublishPath == s3a://* ]] && cleanup_versions "$hdfsPublishPath" "$ECS_API_KK"
[[ $STD_HDFS_PATH == s3a://* ]] && cleanup_versions "$STD_HDFS_PATH" "$ECS_API_KK"
[[ $hdfsPublishPath == s3a://* ]] && cleanup_versions "$hdfsPublishPath/enceladus_info_date=$report_date" "$ECS_API_KK"
[[ $std_path == s3a://* ]] && replace_std_path_placeholders && cleanup_versions "$std_path"

exit $exit_code

0 comments on commit ba01fab

Please sign in to comment.