From 6f5fb0b329bb577d38d5aa51f874bd5e8f6497bc Mon Sep 17 00:00:00 2001
From: rschoene <rene.schoene@tu-dresden.de>
Date: Fri, 19 Aug 2022 18:26:52 +0200
Subject: [PATCH] new version

- add content of this repo as "repo_models2022.tar"
- update README
- add upload script for zenodo (requires token.txt for authentification)
---
 .gitignore         |  1 +
 README.md          |  7 +++++--
 create-artifact.sh | 21 +++++++++++++--------
 models2022.zip     |  4 ++--
 upload.sh          | 25 +++++++++++++++++++++++++
 5 files changed, 46 insertions(+), 12 deletions(-)
 create mode 100755 upload.sh

diff --git a/.gitignore b/.gitignore
index fccfa98..3d936a9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
 /shared_directory_images/
 !models2022.zip
+models2022.zip.bck
diff --git a/README.md b/README.md
index b21ea99..d1c9786 100644
--- a/README.md
+++ b/README.md
@@ -8,7 +8,7 @@ To quickly run the graphical example applications, Docker is used.
 Please note that the setup uses vnc and thus offers limited graphics performance.
 
 - Install Docker and docker-compose for your system (for Windows and Mac OS, install Docker Desktop)
-- For artifact evaluation:
+- For artifact evaluation (prepared docker images):
     - Unpack the provided archive
     - Load the five docker images (they require around 7GB in total)
         - `docker load -i models2022_web.tar`
@@ -18,11 +18,14 @@ Please note that the setup uses vnc and thus offers limited graphics performance
         - `docker load -i models2022_ros_place.tar`
     - Verify, that the docker images have loaded correctly by running `docker images` and check for the four names `models2022_rag_place`, `models2022_coordinator`, `models2022_ros_place`, `models2022_web` and `eclipse-mosquitto` (all with tag `latest`)
     - Create a new directory `models2022` and unpack the archive `workspace.tar` there. It contains all (remaining) necessary parts for the docker-compose build. Please ensure, that there are empty directories `ros3rag`, `web-ros3rag` and `coordinator`. Otherwise docker-compose will produce an error.
-- For all others:
+- From source code (clone):
     - Clone this repo and its submodules (**Important**: Use `--recurse-submodules`):
         - `git clone --recurse-submodules https://git-st.inf.tu-dresden.de/ceti/ros/models2022.git models2022`
         - Change into the workspace `cd models2022`
         - Prepare/Build all docker images: `docker-compose build` (this will take a while)
+- From source code (packaged repository):
+    - Extract the repository `tar xf repo_models2022.tar`
+    - Prepare/Build all docker images: `docker-compose build` (this will take a while)
 
 ## Description of the Expected Outcome of the Case Study
 
diff --git a/create-artifact.sh b/create-artifact.sh
index 4fa5fd4..d3c2718 100755
--- a/create-artifact.sh
+++ b/create-artifact.sh
@@ -4,12 +4,16 @@ set -x
 my_directory=$(pwd -P)
 
 ## ragconnect
-( cd ~/git/jastadd/ragconnect && git archive -o ${my_directory}/ragconnect.tar dev )
-( cd ~/git/jastadd/ragconnect/pages && mkdocs build && tar cf ${my_directory}/ragconnect_pages.tar ../public/* )
+( cd ~/git/jastadd/ragconnect && git archive -o ${my_directory}/repo_ragconnect.tar dev )
+( cd ~/git/jastadd/ragconnect/pages && mkdocs build && tar cf ${my_directory}/pages_ragconnect.tar ../public/* )
 
 ## minimal example
-( cd ~/git/jastadd/minimal-ragconnect && git archive -o ${my_directory}/minimal_example.tar master )
-( cd ~/git/jastadd/minimal-ragconnect/pages && mkdocs build && tar cf ${my_directory}/minimal_example_pages.tar ../public/* )
+( cd ~/git/jastadd/minimal-ragconnect && git archive -o ${my_directory}/repo_minimal_example.tar master )
+( cd ~/git/jastadd/minimal-ragconnect/pages && mkdocs build && tar cf ${my_directory}/pages_minimal_example.tar ../public/* )
+
+## this repository
+mv models2022.zip models2022.zip.bck || echo "artefact already moved"
+tar cf repo_models2022.tar  --exclude=models2022.zip --exclude='*.tar' --exclude-vcs --exclude-vcs-ignores --exclude='token.txt' --exclude='submodule-sheet.ods' --exclude='upload.*' .
 
 ## containered
 docker save models2022_web:latest > models2022_web.tar
@@ -25,10 +29,11 @@ tar rf workspace.tar --no-recursion shared_directory_images ros3rag web-ros3rag
 ## bundle everything together
 zip models2022 \
     workspace.tar \
-    ragconnect.tar \
-    ragconnect_pages.tar \
-    minimal_example.tar \
-    minimal_example_pages.tar \
+    repo_models2022.tar \
+    repo_ragconnect.tar \
+    pages_ragconnect.tar \
+    repo_minimal_example.tar \
+    pages_minimal_example.tar \
     models2022_web.tar \
     models2022_mosquitto.tar \
     models2022_rag_place.tar \
diff --git a/models2022.zip b/models2022.zip
index 8ba41ee..7796444 100644
--- a/models2022.zip
+++ b/models2022.zip
@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:3ce1ae2771e0acaead3322397ac256ca640f801fc20c4b955299b241ef68570f
-size 3148774412
+oid sha256:1d6a01d77f85a5effc3efe7bc71ba479fa22ab5d54094cc848e91b2a442cff96
+size 3160608632
diff --git a/upload.sh b/upload.sh
new file mode 100755
index 0000000..adeaf0e
--- /dev/null
+++ b/upload.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+ZENODO_TOKEN=$(<token.txt)
+#curl -i -H "Content-Type: application/json" -X POST
+#     --data '{"metadata": {"title": "My first upload", "upload_type": "poster", "description": "This is my first upload", "creators": [{"name": "Doe, John", "affiliation": "Zenodo"}]}}' /api/deposit/depositions/?access_token=ACCESS_TOKEN
+
+# curl -i -H "Authorization: Bearer $ACCESS_TOKEN" 'https://zenodo.org/api/deposit/depositions'
+#curl -i -H "Authorization: Bearer $ACCESS_TOKEN" -X POST -F name=models2022.zip -F file=@models2022.zip \
+#     'https://zenodo.org/api/deposit/depositions/6963426/files'
+
+#!/bin/bash
+# Upload big files to Zenodo.
+#
+# usage: ./zenodo_upload.sh [deposition id] [filename]
+#
+
+set -e
+
+# strip deposition url prefix if provided; see https://github.com/jhpoelen/zenodo-upload/issues/2#issuecomment-797657717
+DEPOSITION=$( echo $1 | sed 's+^http[s]*://zenodo.org/deposit/++g' )
+FILEPATH="$2"
+FILENAME=$(echo $FILEPATH | sed 's+.*/++g')
+
+BUCKET=$(curl https://zenodo.org/api/deposit/depositions/"$DEPOSITION"?access_token="$ZENODO_TOKEN" | jq --raw-output .links.bucket)
+
+curl --progress-bar -o /dev/null --upload-file "$FILEPATH" $BUCKET/"$FILENAME"?access_token="$ZENODO_TOKEN"
-- 
GitLab