File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
cloudinary-test-common/scripts Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ # Create the unsigned upload preset required for tests
4+ # Currently only required for the Android test since Android API cannot create the preset
5+
6+ UNSIGNED_PRESET=" cloudinary_java_test"
7+ SDK_TEST_TAG=" cloudinary_java_test"
8+
9+ if [ -z ${CLOUDINARY_URL+x} ]
10+ then echo " The variable CLOUDINARY_URL must be set!"
11+ else
12+
13+ API_CRED=${CLOUDINARY_URL%@* }
14+ API_CRED=${API_CRED#*// }
15+ if curl -s " https://${API_CRED#*// } @api.cloudinary.com/v1_1/${CLOUDINARY_URL#*@ } /upload_presets/${UNSIGNED_PRESET} " | \
16+ grep --quiet " Can't find upload preset named"
17+ then curl --data " name=${UNSIGNED_PRESET} &unsigned=true&tags=${TAG} " \
18+ " https://${API_CRED#*// } @api.cloudinary.com/v1_1/${CLOUDINARY_URL#*@ } /upload_presets"
19+ echo
20+ else
21+ echo " Preset already exists"
22+ fi
23+ fi
You can’t perform that action at this time.
0 commit comments