diff --git a/bin/Makefile b/bin/Makefile index 0edf09e6..1a1984e4 100644 --- a/bin/Makefile +++ b/bin/Makefile @@ -1,40 +1,45 @@ DEPOSIT_ID=1 ARCHIVE=../../swh-deposit.zip ARCHIVE2=../../swh-model.zip STATUS=false PARTIAL_STATUS=true UPDATE_STATUS='success' +ATOM_ENTRY=../../atom-entry.xml +EXTERNAL_ID='external-id' create-archives: 7z a $(ARCHIVE) $(FOLDER) 7z a $(ARCHIVE2) $(FOLDER2) new: ./create_deposit.sh $(ARCHIVE) $(STATUS) +new-complete: + ./create_deposit_with_metadata.sh $(ARCHIVE) $(ATOM_ENTRY) $(STATUS) $(EXTERNAL_ID) + new-partial: make new STATUS=$(PARTIAL_STATUS) ARCHIVE=$(ARCHIVE) update: ./update-deposit-with-another-archive.sh $(DEPOSIT_ID) $(ARCHIVE2) $(STATUS) update-partial: make update DEPOSIT_ID=$(DEPOSIT_ID) ARCHIVE2=$(ARCHIVE2) STATUS=$(PARTIAL_STATUS) replace: ./replace-deposit-archive.sh $(ARCHIVE2) $(DEPOSIT_ID) download: ./download-deposit-archive.sh $(DEPOSIT_ID) status: ./status.sh $(DEPOSIT_ID) service-document: ./service-document.sh home: ./home.sh update-status: ./update-status.sh $(DEPOSIT_ID) $(UPDATE_STATUS) diff --git a/bin/create_deposit_with_metadata.sh b/bin/create_deposit_with_metadata.sh index 3a238bba..92034750 100755 --- a/bin/create_deposit_with_metadata.sh +++ b/bin/create_deposit_with_metadata.sh @@ -1,18 +1,20 @@ #!/usr/bin/env bash . ./default-setup -ARCHIVE=${1-'../../deposit.zip'} +ARCHIVE=${1-'../../swh-deposit.zip'} ATOM_ENTRY=${2-'../../atom-entry.xml'} -NAME=$(basename $ARCHIVE) +NAME=$(basename $ARCHIVE) MD5=$(md5sum $ARCHIVE | cut -f 1 -d' ') PROGRESS=${3-'false'} +EXTERNAL_ID=${4-'external-id'} +set -x curl -i --user "${CREDS}" \ - -F "file=@${ARCHIVE};type=application/zip;filename=payload" \ - -F "atom=@${ATOM_ENTRY};type=application/atom+xml;charset=UTF-8" \ -H "In-Progress: ${PROGRESS}" \ - -H 'Slug: some-external-id' \ + -H "Slug: ${EXTERNAL_ID}" \ + -F "file=@${ARCHIVE};type=application/zip" \ + -F "atom=@${ATOM_ENTRY};type=application/atom+xml;type=entry" \ -XPOST ${SERVER}/1/${COLLECTION}/