Skip to content

feat: allow running updater as one-off command #14

feat: allow running updater as one-off command

feat: allow running updater as one-off command #14

name: Docker test run as command
on:
push:
branches:
- 'main'
tags:
- '*'
pull_request:
jobs:
docker-test:
env:
COMPOSE_ARGS: -f docker-compose.yml -f docker-compose.ci.command.yml
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: docker-compose up
run: docker-compose ${{ env.COMPOSE_ARGS }} up -d
- name: Create entities
run: |
docker compose exec api /usr/src/app/create-entities.js 40
- name: Run updater
run: |
docker compose exec wdqs-updater /wdqsup/runUpdateWbStack.sh -- \
--wikibaseHost wikibase.svc \
--ids Q1,Q2,Q3,Q4,Q5,Q6,Q7,Q8,Q9,Q10,Q11,Q12,Q13,Q14,Q15 \
--entityNamespaces 120,122,146 \
--sparqlUrl http://wdqs.svc:9999/bigdata/namespace/wdq/sparql \
--wikibaseScheme http \
--conceptUri https://wikibase.svc
docker compose exec wdqs-updater /wdqsup/runUpdateWbStack.sh -- \
--wikibaseHost wikibase.svc \
--ids Q16,Q17,Q18,Q19,Q20,Q21,Q22,Q23,Q24,Q25,Q26,Q27,Q28,Q29,Q30 \
--entityNamespaces 120,122,146 \
--sparqlUrl http://wdqs.svc:9999/bigdata/namespace/wdq/sparql \
--wikibaseScheme http \
--conceptUri https://wikibase.svc
- name: Make a sparql request
run: |
NUM_BINDINGS=$(curl 'http://localhost:9999/bigdata/namespace/wdq/sparql' -H 'Accept: application/sparql-results+json' --data-raw 'query=SELECT+*+WHERE%7B+%3Fs+%3Fp+%3Fo+%7D' | jq '.results.bindings | length')
# should be 30
if [[ "$NUM_BINDINGS" -lt 30 ]]; then
exit 1
fi
- name: docker-compose logs > output.log
if: always()
run: docker-compose ${{ env.COMPOSE_ARGS }} logs --no-color > "output.log"
- name: Archive output.log
uses: actions/upload-artifact@v2
if: always()
with:
name: DockerTestLog
if-no-files-found: error
path: output.log