Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
ESCAPE2020
WP3
ZenodoCI
Commits
414e09c3
Commit
414e09c3
authored
Aug 03, 2020
by
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
Changes
4
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
12 deletions
+13
-12
.gitlab-ci.yml
.gitlab-ci.yml
+9
-8
.zenodoci/upload_new_deposit.py
.zenodoci/upload_new_deposit.py
+1
-1
.zenodoci/upload_new_version_deposit.py
.zenodoci/upload_new_version_deposit.py
+1
-1
.zenodoci/zenodoapi.py
.zenodoci/zenodoapi.py
+2
-2
No files found.
.gitlab-ci.yml
View file @
414e09c3
...
...
@@ -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
.zenodoci/upload_new_deposit.py
View file @
414e09c3
...
...
@@ -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"
)
...
...
.zenodoci/upload_new_version_deposit.py
View file @
414e09c3
...
...
@@ -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"
)
...
...
.zenodoci/zenodoapi.py
View file @
414e09c3
...
...
@@ -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
.
dump
s
(
data
),
headers
=
headers
,
params
=
parameters
)
def
erase_file_entry
(
self
,
entry_id
,
file_id
):
"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment