Base image used to provide environment for the old ETL bash script.
3.5K
mytsql is the current ETL shell script for extracting, transforming and loading Casebook database data to other database targets e.g. the DataWarehousing database.
# From the Casebook repo root; make sure you are on the CB branch you want to test against!
#
# boot the DB
cd docker/shared-services && docker-compose up --no-deps -d db
# create the schema and seed.
# this WILL throw an error at the end
# as Rails tries to push the updates to Elasticsearch
# but that's ok as it doesn't affect the data in the db.
cd ../../ && docker-compose -f docker-compose.yml run --rm casebook \
bundle exec rake db:setup db:seed DISABLE_DATABASE_ENVIRONMENT_CHECK=true
Casebook and CABReporting_DW / check .env /The DW can be accessed on localhost:1433; the username / password are in the .env file
# in the casebook_migration folder of the casebook-db-migration repo:
$ bin/setup_local_dw
to use Flyway instead of Liquibase run:
$ DB_MIGRATION_TOOL=flyway bin/setup_local_dw
$ bin/local_autocbexe
To test incremental updates:
# runs mytsql-stable autocbtempexe followed by
# mytsql-stable autocbtempcacheexe
$ bin/local_incremental
There are a number of environment variables whose defaults are in the .env file. They can be overridden by:
-e KEY=val when running docker-composeNOTE The sqlcli docker-compose service uses some environment variables
in its service.command. These must be set before compose makes env variables available to the container.
This is the reason to have the .env file in the root of this folder - compose will evaluate any ${...} expressions in its config before it attempts to start services.
$ docker-compose run -e LIQUIBASE_DB_USER=admin \
-e LIQUIBASE_DB_PASSWORD=1234 \
-e LIQUIBASE_JDBC_URL="jdbc:sqlserver://${TSQLHOST}:1433;databaseName=${TSQLDATABASE}" \
--rm liquibase
$ docker-compose run --rm flyway \
-url="jdbc:sqlserver://${TSQLHOST}:1433;databaseName=${TSQLDATABASE};integratedSecurity=false;" \
-user=${TSQLUSER} -password=${SA_PASSWORD} -connectRetries=60 migrate
docker-compose run -e PGPASSWORD=<pg_pass> -e PGHOST=<pg_host> -e ... mytsql
docker-compose run -f docker-compose.yml -e SA_PASSWORD=<dw_pass> -e TSQLHOST=<dw_host> -e ... mytsql
$ docker-compose run -f docker-compose.yml -e PGPASSWORD=<pg_pass> -e PGHOST=<pg_host> \
-e SA_PASSWORD=<dw_pass> -e TSQLHOST=<dw_host> -e ... mytsql
Content type
Image
Digest
Size
389.2 MB
Last updated
over 5 years ago
docker pull citizensadvice/db_migration_base