Skip to content

Commit 596c2b1

Browse files
authored
Backport PR3233 to relase/3.4 (#3236)
* backport PR3233 to release/3.4
1 parent 2ff6a12 commit 596c2b1

File tree

1 file changed

+21
-9
lines changed

1 file changed

+21
-9
lines changed

operator/integration-tests/model-in-image/mii-sample-wrapper/stage-tooling.sh

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Copyright (c) 2019, 2021, Oracle and/or its affiliates.
2+
# Copyright (c) 2019, 2022, Oracle and/or its affiliates.
33
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
44

55
#
@@ -73,21 +73,33 @@ download_zip() {
7373
fi
7474
echo "@@ Info: The location URL matched regex 'https://github.com.*/latest$' so it was converted to '$LOCATION'"
7575
echo "@@ Info: Now downloading '$LOCATION' to '$WORKDIR/$ZIPFILE'."
76-
fi
7776

78-
if [ ! "$dry_run" = "true" ]; then
79-
rm -f $ZIPFILE
80-
echo "@@ Info: Calling 'curl $curl_parms -fL $LOCATION/$ZIPFILE -o $ZIPFILE'"
81-
curl $curl_parms -fL $LOCATION/$ZIPFILE -o $ZIPFILE
77+
if [ ! "$dry_run" = "true" ]; then
78+
rm -f $ZIPFILE
79+
echo "@@ Info: Calling 'curl $curl_parms -fL $LOCATION/$ZIPFILE -o $ZIPFILE'"
80+
curl $curl_parms -fL $LOCATION/$ZIPFILE -o $ZIPFILE
81+
else
82+
echo "dryrun:rm -f $ZIPFILE"
83+
echo "dryrun:curl $curl_parms -fL $LOCATION/$ZIPFILE -o $ZIPFILE"
84+
fi
8285
else
83-
echo "dryrun:rm -f $ZIPFILE"
84-
echo "dryrun:curl $curl_parms -fL $LOCATION/$ZIPFILE -o $ZIPFILE"
86+
echo "@@ Info: The location URL does not match regex 'https://github.com.*/latest$' "
87+
echo "@@ Info: Downloading from custom URL '$LOCATION' to '$WORKDIR/$ZIPFILE' "
88+
if [ ! "$dry_run" = "true" ]; then
89+
rm -f $ZIPFILE
90+
echo "@@ Info: Calling 'curl $curl_parms -fL $LOCATION -o $ZIPFILE'"
91+
curl $curl_parms -fL $LOCATION -o $ZIPFILE
92+
else
93+
echo "dryrun:rm -f $ZIPFILE"
94+
echo "dryrun:curl $curl_parms -fL $LOCATION -o $ZIPFILE"
95+
fi
8596
fi
97+
8698
}
8799

88100
if [ "$dry_run" = "true" ]; then
89101
echo "dryrun:#!/bin/bash"
90-
echo "dryrun:# Copyright (c) 2019, 2021, Oracle and/or its affiliates."
102+
echo "dryrun:# Copyright (c) 2019, 2022, Oracle and/or its affiliates."
91103
echo "dryrun:# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl."
92104
echo "dryrun:"
93105
echo "dryrun:set -eux"

0 commit comments

Comments
 (0)