-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #176 from neicnordic/latest_from_upstream
Latest from upstream
- Loading branch information
Showing
116 changed files
with
4,335 additions
and
1,211 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,36 @@ | ||
#!/bin/sh | ||
set -eou pipefail | ||
|
||
result=$(psql -U postgres -h postgres -d sda -At -c "SELECT submission_file_path,submission_user from sda.files;") | ||
path=$(echo "$result" | cut -d '|' -f1) | ||
user=$(echo "$result" | cut -d '|' -f2) | ||
|
||
export PGPASSWORD=ingest | ||
user="test-user" | ||
corrID="33d29907-c565-4a90-98b4-e31b992ab376" | ||
|
||
## insert file | ||
resp=$(psql -U ingest -h postgres -d sda -At -c "UPDATE local_ega.main SET status = 'IN_INGESTION' WHERE local_ega.main.submission_file_path = '$path' AND local_ega.main.submission_user = '$user' AND local_ega.main.status = 'INIT' RETURNING id;") | ||
if [ "$(echo "$resp" | tr -d '\n')" != "1UPDATE 1" ]; then | ||
fileID=$(psql -U ingest -h postgres -d sda -At -c "SELECT sda.register_file('inbox/test-file.c4gh', '$user');") | ||
if [ -z "$fileID" ]; then | ||
echo "register_file failed" | ||
exit 1 | ||
fi | ||
|
||
resp=$(psql -U ingest -h postgres -d sda -At -c "INSERT INTO sda.file_event_log(file_id, event, correlation_id, user_id, message) VALUES('$fileID', 'submitted', '$corrID', '$user', '{}');") | ||
if [ "$(echo "$resp" | tr -d '\n')" != "INSERT 0 1" ]; then | ||
echo "insert file failed" | ||
exit 1 | ||
fi | ||
|
||
## store header | ||
resp=$(psql -U ingest -h postgres -d sda -At -c "UPDATE local_ega.files SET header = '637279707434676801000000010000006c00000000000000' WHERE id = 1;") | ||
resp=$(psql -U ingest -h postgres -d sda -At -c "UPDATE sda.files SET header = '637279707434676801000000010000006c00000000000000' WHERE id = '$fileID';") | ||
if [ "$resp" != "UPDATE 1" ]; then | ||
echo "store header failed" | ||
exit 1 | ||
fi | ||
|
||
## set archived | ||
archive_path=d853c51b-6aed-4243-b427-177f5e588857 | ||
size="2035150" | ||
checksum="f03775a50feea74c579d459fdbeb27adafd543b87f6692703543a6ebe7daa1ff" | ||
resp=$(psql -U ingest -h postgres -d sda -At -c "UPDATE local_ega.files SET status = 'ARCHIVED', archive_path = '$archive_path', archive_filesize = '$size', inbox_file_checksum = '$checksum', inbox_file_checksum_type = 'SHA256' WHERE id = 1;") | ||
if [ "$resp" != "UPDATE 1" ]; then | ||
resp=$(psql -U ingest -h postgres -d sda -At -c "SELECT sda.set_archived('$fileID', '$corrID', '$archive_path', '$size', '$checksum', 'SHA256');") | ||
if [ "$resp" != "" ]; then | ||
echo "mark file archived failed" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.