This is the WorkBC Single Source of Truth (SSoT) API service.
GET
will fail with a permission errordocker-compose build && docker-compose up
ssot
database directly via postgresql://workbc:workbc@localhost/ssot
docker-compose exec -T postgres psql --username workbc ssot < ssot-grants.sql \
&& docker-compose exec -T postgres pg_dump --clean --username workbc ssot | gzip > ssot-full.sql.gz \
&& gunzip -k -c ssot-full.sql.gz > ssot-full.sql
docker-compose exec -T postgres psql --username workbc ssot < ssot-reset.sql \
&& gunzip -k -c ssot-full.sql.gz | docker-compose exec -T postgres psql --username workbc ssot \
&& docker-compose kill -s SIGUSR1 ssot
Please refer to migration/README.md.
docker-compose exec -T postgres pg_dump --clean --username workbc ssot | gzip > ssot-full.sql.gz
/admin/config/development/backup_migrate/restore
then select Restore To > SSoT Database and upload the file ssot-full.sql.gz
.ssot-refresh.sql
which is included in this repo.Using GitHub Repository Dispatch API call, a data sheet rebuild can be triggered. At the moment, only dataset monthly_labour_market_update
is supported.
The following steps are carried out by the rebuild:
migration/data/
migration/load/
migration/load/sources.csv
to reflect the changedocker-compose
sources
) into the running databasessot-full.sql
and ssot-full.sql.gz
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/OWNER/REPO/dispatches \
-d '{"event_type":"monthly_labour_market_update","client_payload":{
"branch": "Branch where rebuild should happen",
"filename": "Filename of the existing data sheet in migration/data",
"year": "Numeric value of the period year of the target dataset",
"month": "Numeric value of the period month of the target dataset",
"date": "Full date of production/reception of the data sheet in YYYY/MM/DD hh:mm format (UTC timezone)",
"notes": "Commit message to update files into GitHub"
}}'