Commit 414e09c3 authored by Enrique Garcia's avatar Enrique Garcia
Browse files

Merge branch 'first_release' into 'master'

First release

See merge request escape2020/escape/zenodoci!1
parents 209a062a 72f06d84
Pipeline #78662 passed with stage
in 1 minute and 9 seconds
......@@ -19,7 +19,9 @@ deploy_zenodo:
- pip3 install requests
### 2 - Get the last tag/release of the repository
- export REPOSITORY_NAME=template_project_escape
- export REPOSITORY_NAME=zenodoci
- export REPOSITORY_URL=https://gitlab.in2p3.fr/escape2020/escape/$REPOSITORY_NAME.git
- export LAST_RELEASE=`git ls-remote --tags --refs --sort="v:refname" $REPOSITORY_URL | tail -n1 | sed 's/.*\///'`
......@@ -28,14 +30,13 @@ deploy_zenodo:
- mkdir -p build
- >
if [ -z "$LAST_RELEASE" ]
then
echo "No tag / new release found ! - Or error when parsing. Downloading last commit to the repository (master branch) ;"
wget -O $REPOSITORY_NAME-master.zip https://gitlab.in2p3.fr/escape2020/escape/"$REPOSITORY_NAME"/-/archive/master/"$REPOSITORY_NAME"-master.zip
if [ -z "$LAST_RELEASE" ]; then
echo "No tag / new release found ! - Or error when parsing. Downloading last commit to the repository (master branch) ;"; \
wget -O $REPOSITORY_NAME-master.zip https://gitlab.in2p3.fr/escape2020/escape/"$REPOSITORY_NAME"/-/archive/master/"$REPOSITORY_NAME"-master.zip; \
mv $REPOSITORY_NAME-master.zip ./build
else
echo "$LAST_RELEASE tag / release found !"
wget -O $REPOSITORY_NAME-$LAST_RELEASE.zip https://gitlab.in2p3.fr/escape2020/escape/"$REPOSITORY_NAME"/-/archive/"$LAST_RELEASE"/"$REPOSITORY_NAME"-"$LAST_RELEASE".zip
echo "$LAST_RELEASE tag / release found !"; \
wget -O $REPOSITORY_NAME-$LAST_RELEASE.zip https://gitlab.in2p3.fr/escape2020/escape/"$REPOSITORY_NAME"/-/archive/"$LAST_RELEASE"/"$REPOSITORY_NAME"-"$LAST_RELEASE".zip; \
mv $REPOSITORY_NAME-$LAST_RELEASE.zip ./build
fi
......@@ -68,4 +69,4 @@ deploy_zenodo:
### Ideally this stage should be run only when a new release / tag of the source code is created (- tags).
# The script is changed to check that the both `upload_new_deposit` and `upload_new_version_deposit` works nicely.
- tags
- master
\ No newline at end of file
- branches
\ No newline at end of file
......@@ -3,7 +3,7 @@ import os
import json
import argparse
from distutils.util import strtobool
from .zenodoapi import ZenodoAPI
from zenodoapi import ZenodoAPI
parser = argparse.ArgumentParser(description="Upload new deposit entry to Zenodo")
......
......@@ -3,7 +3,7 @@ import os
import json
import argparse
from distutils.util import strtobool
from .zenodoapi import ZenodoAPI
from zenodoapi import ZenodoAPI
parser = argparse.ArgumentParser(description="Upload a new version of an existing deposit to Zenodo")
......
......@@ -44,7 +44,7 @@ class ZenodoAPI:
headers = {"Content-Type": "application/json"}
parameters = {'access_token': self.access_token}
return requests.post(url, headers=headers, params=parameters)
return requests.post(url, json={}, headers=headers, params=parameters)
def upload_file_entry(self, entry_id, name_file, path_file):
"""
......@@ -92,7 +92,7 @@ class ZenodoAPI:
headers = {"Content-Type": "application/json"}
parameters = {'access_token': self.access_token}
return requests.put(url, data=json.dump(data), headers=headers, params=parameters)
return requests.put(url, data=json.dumps(data), headers=headers, params=parameters)
def erase_file_entry(self, entry_id, file_id):
"""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment