diff --git a/ogc/bblocks/entrypoint.py b/ogc/bblocks/entrypoint.py index 24371f7..9e6b25d 100644 --- a/ogc/bblocks/entrypoint.py +++ b/ogc/bblocks/entrypoint.py @@ -1,4 +1,5 @@ #!/usr/bin/env python3 +import datetime import os import shutil import subprocess @@ -181,6 +182,8 @@ if sparql_conf and sparql_conf.get('query'): register_additional_metadata['sparqlEndpoint'] = sparql_conf['query'] + register_additional_metadata['modified'] = datetime.datetime.now().isoformat() + if os.environ.get('BBP_GIT_INFO_FILE'): with open(os.environ['BBP_GIT_INFO_FILE']) as f: git_info = f.readline().strip() @@ -209,6 +212,9 @@ base_url = f"https://{gh_repo[0]}.github.io/{gh_repo[1]}/" github_base_url = f"https://github.com/{gh_repo[0]}/{gh_repo[1]}/" print(f"Autodetected GitHub repo {gh_repo[0]}/{gh_repo[1]}") + register_additional_metadata['gitHubRepository'] = github_base_url + if remote_url: + register_additional_metadata['gitRepository'] = remote_url except: print('[WARN] Could not autodetect base_url / github_base_url', file=sys.stderr) pass