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 1233779
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 2 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/validate-and-process.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ on:
type: string
description: Path where to deploy the viewer
default: '.'
secrets:
sparql_username:
description: SPARQL Graph Store Protocol user name for push authentication
required: false
sparql_password:
description: SPARQL Graph Store Protocol password for push authentication
required: false


permissions:
Expand Down Expand Up @@ -108,6 +115,8 @@ jobs:
github_base_url: ${{ inputs.github_base_url }}
deploy_viewer: ${{ inputs.deploy_viewer && 'true' || 'false' }}
viewer_path: ${{ inputs.viewer_path }}
sparql_username: ${{ secrets.sparql_username }}
sparql_password: ${{ secrets.sparql_password }}
- name: Compress large _visited_properties.tsv and git pull
run: |
sudo find "${{ inputs.annotated_path }}" -size +10M -name _visited_properties.tsv \
Expand Down
8 changes: 8 additions & 0 deletions full/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ inputs:
viewer_path:
description: Path where to deploy the viewer
default: '.'
sparql_username:
description: SPARQL GSP push user name
default: ''
sparql_password:
description: SPARQL GSP push password
default: ''

runs:
using: composite
Expand All @@ -60,6 +66,8 @@ runs:
github_base_url: ${{ inputs.github_base_url }}
deploy_viewer: ${{ inputs.deploy_viewer }}
viewer_path: ${{ inputs.viewer_path }}
sparql_username: ${{ inputs.sparql_username }}
sparql_password: ${{ inputs.sparql_password }}
- name: Generate Slate documentation
continue-on-error: true
run: |
Expand Down
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.items())
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
9 changes: 9 additions & 0 deletions postprocess/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,19 @@ inputs:
viewer_path:
description: Path where to deploy the viewer
default: '.'
sparql_username:
description: SPARQL GSP push user name
default: ''
sparql_password:
description: SPARQL GSP push password
default: ''

runs:
using: docker
image: docker://ghcr.io/opengeospatial/bblocks-postprocess
env:
SPARQL_USERNAME: ${{ inputs.sparql_username }}
SPARQL_PASSWORD: ${{ inputs.sparql_password }}
args:
- '--register-file'
- ${{ inputs.register_file }}
Expand Down

0 comments on commit 1233779

Please sign in to comment.