This commit is contained in:
Your Name
2025-05-25 11:11:44 +12:00
parent 89bdd04ff8
commit 3db0208fe9
4 changed files with 7 additions and 95 deletions

View File

@@ -53,11 +53,16 @@ BASE_TAG="autotest"
# upload this script as an object
echo "uploading ${SCRIPT_DIR}/${SCRIPT_NAME} to ${BASE_TAG}:test1"
OBJECT_HASH=$(curl -X PUT \
UPLOAD_RESPONSE=$(curl -X PUT \
-H "Authorization: Bearer ${WRITE_TOKEN}" \
-F "file=@${SCRIPT_DIR}/${SCRIPT_NAME}" \
-F 'metadata={"labeltag":"${BASE_TAG}:test1","description":"Example file","tags":["test","example"],"custom_field":"custom value"}' \
"http://localhost:8123/upload" | jq -r '.hash')
"http://localhost:8123/upload")
echo "upload response: ${UPLOAD_RESPONSE}"
OBJECT_HASH=$(echo ${UPLOAD_RESPONSE} | jq -r '.hash')
#OBJECT_HASH=$(curl -s "${BASE_URL}/upload?token=${WRITE_TOKEN}&labeltag=${BASE_TAG}:test1&filename=${SCRIPT_NAME}" -T ${SCRIPT_DIR}/${SCRIPT_NAME} | jq -r '.hash')
echo "received hash ${OBJECT_HASH}"