Skip to content

Commit

Permalink
improved bin/validate_volume.sh, so you can e.g. debug more easily
Browse files Browse the repository at this point in the history
  • Loading branch information
mwarin committed Aug 30, 2024
1 parent c3281bd commit b2ef829
Showing 1 changed file with 34 additions and 3 deletions.
37 changes: 34 additions & 3 deletions bin/validate_volume.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,33 @@
# bash validate_volume.sh /path/to/item.zip
# In its barest form, test a -p simple -n test volume with:
# bash validate_volume.sh -z /path/to/item.zip

fullpath=$(realpath $1)
# Default args:
clean=""
zip_path=""
debug=""
namespace="test"
packagetype="simple"

# Override default args:
while true; do
case "$1" in
-c | --clean ) clean="--clean"; shift 1 ;;
-d | --debug ) debug="-d"; shift 1 ;;
-z | --zip_path ) zip_path="$2"; shift 2 ;;
-n | --namespace ) namespace="$2"; shift 2 ;;
-p | --packagetype ) packagetype="$2"; shift 2 ;;
-- ) shift; break ;;
* ) break ;;
esac
done

# Check required args:
if [ -z "$zip_path" ]; then
echo "missing required param -z/--zip_path"
exit 1
fi

fullpath=$(realpath $zip_path)
objid=$(basename $fullpath .zip)
test_dir=/tmp/prep/toingest/test/

Expand All @@ -9,4 +36,8 @@ rm --verbose -rf "$test_dir"
mkdir --verbose -p "$test_dir"
cp --verbose "$fullpath" "$test_dir"

perl /usr/local/feed/bin/validate_volume.pl -1 simple test $objid --clean
# Output the full command & run it
cmd="perl $debug /usr/local/feed/bin/validate_volume.pl -1 $packagetype $namespace $objid $clean"
echo "---"
echo "RUNNING: $cmd"
eval "$cmd"

0 comments on commit b2ef829

Please sign in to comment.