Skip to content

Commit

Permalink
Merge tag '1.7.0_no_kubectl'
Browse files Browse the repository at this point in the history
Latest ec3 withouth k8s
  • Loading branch information
orviz committed Sep 28, 2022
2 parents d451551 + b360a21 commit 0c249f0
Show file tree
Hide file tree
Showing 5 changed files with 288 additions and 34 deletions.
5 changes: 4 additions & 1 deletion QC.Doc/find_doc_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

# Types of files to look for
FILE_TYPES = [
'all',
'README',
'CODE_OF_CONDUCT',
'CONTRIBUTING'
Expand Down Expand Up @@ -80,7 +81,9 @@ def find_file(file_type, extensions, check_single_path=None):

def main():
args = get_input_args()
if not args.file_type:

FILE_TYPES.remove('all')
if not args.file_type or args.file_type in ['all']:
args.file_type = FILE_TYPES
else:
args.file_type = [args.file_type]
Expand Down
60 changes: 60 additions & 0 deletions QC.FAIR/fuji.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/usr/bin/python3

import argparse
import json
import requests


def get_input_args():
parser = argparse.ArgumentParser(description=(
'Prepare requests for FAIR assessment tool'
))
parser.add_argument(
'-OID',
metavar='object_identifier',
type=str,
help='Object Persistent Identifier. I.e.: DOI, Handle, LandingPage '
'URL, etc.',
required=True
)
parser.add_argument(
'--tool_endpoint',
metavar='tool_endpoint',
type=str,
help='Tool endpoint to perform HTTP request. Example: '
'http://localhost:1071/fuji/api/v1/evaluate',
required=True
)
parser.add_argument(
'-T',
metavar='metadata_service_type',
choices=['oai_pmh', 'sparql', 'ogc_csw'],
type=str,
help='Type of the Metadata service. One of: "oai_pmh", "sparql" or '
'"ogc_csw".'
)
parser.add_argument(
'-E',
metavar='metadata_service_endpoint',
type=str,
help='Metadata service endpoint URL.'
)
return parser.parse_args()


def main():
args = get_input_args()
url = args.tool_endpoint
headers = {'Content-Type': 'application/json'}
data = {
"object_identifier": args.OID,
"metadata_service_endpoint": args.E,
"metadata_service_type": args.T,
"test_debug": True,
"use_datacite": True
}
r = requests.post(url, data=json.dumps(data), headers=headers)
return json.dumps(r.text)


print(main())
6 changes: 6 additions & 0 deletions QC.Ver/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM python:3.9-alpine
LABEL maintainer="Pablo Orviz <[email protected]>"
RUN apk --no-cache add build-base git
RUN python3 -m pip install GitPython==3.1.27
COPY get_git_tags.py /usr/bin
RUN chmod +x /usr/bin/get_git_tags.py
34 changes: 34 additions & 0 deletions QC.Ver/get_git_tags.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env python

import argparse
import git


def get_input_args():
parser = argparse.ArgumentParser(description=(
'Get git release tags associated with the current commit ID.'
))
parser.add_argument(
'--repo-path',
type=str,
default='.',
help='Path to the git repository'
)

return parser.parse_args()


def main():
args = get_input_args()

repo = git.Repo(args.repo_path)
try:
tags = repo.git.describe('--exact-match', 'HEAD')
tag_list = tags.split('\n')
except git.exc.GitCommandError as e:
tag_list = []

return tag_list


print(main())
Loading

0 comments on commit 0c249f0

Please sign in to comment.