Skip to content

Commit

Permalink
Add modified and git metadata to register.json
Browse files Browse the repository at this point in the history
  • Loading branch information
avillar committed Jan 29, 2024
1 parent e58076a commit 653f14f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ogc/bblocks/entrypoint.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env python3
import datetime
import os
import shutil
import subprocess
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 653f14f

Please sign in to comment.