Skip to content

Commit

Permalink
Tests for env variable setting
Browse files Browse the repository at this point in the history
  • Loading branch information
avillar committed Jan 17, 2024
1 parent 4aa952d commit 9b72b78
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ogc/bblocks/entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
if register_name:
register_additional_metadata['name'] = register_name

sparql_conf = bb_config.get('sparql')
sparql_conf = bb_config.get('sparql', {})

base_url = args.base_url
github_base_url = args.github_base_url
Expand Down Expand Up @@ -249,11 +249,13 @@
# 4. Push to triplestore
sparql_gsp = sparql_conf.get('push')
if sparql_gsp:
print(f"Pushing {register_ttl_fn} to SPARQL GSP at {sparql_gsp}", file=sys.stderr)
print(os.environ.keys())
if os.environ.get('SPARQL_USERNAME'):
auth = (os.environ['SPARQL_USERNAME'], os.environ.get('SPARQL_PASSWORD'))
print(f"Pushing {register_ttl_fn} to SPARQL GSP at {sparql_gsp} (user {auth[0]})", file=sys.stderr)
else:
auth = None
print(f"Pushing {register_ttl_fn} to SPARQL GSP at {sparql_gsp}", file=sys.stderr)
sparql_graph = sparql_conf.get('graph') or base_url
update_vocabs.load_vocab(register_ttl_fn,
graph_store=sparql_gsp,
Expand Down
3 changes: 3 additions & 0 deletions postprocess/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ inputs:
runs:
using: docker
image: docker://ghcr.io/opengeospatial/bblocks-postprocess
env:
SPARQL_USERNAME: $SPARQL_USERNAME
SPARQL_PASSWORD: $SPARQL_PASSWORD
args:
- '--register-file'
- ${{ inputs.register_file }}
Expand Down

0 comments on commit 9b72b78

Please sign in to comment.