Skip to content

Commit

Permalink
Playground fixes
Browse files Browse the repository at this point in the history
* Fixed playground environment variables and `cleanup` command.
* Removed `start_period` not required property from `playground-storage`.
  • Loading branch information
wwoytenko committed Feb 11, 2024
1 parent 9e4afa1 commit f142730
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
11 changes: 10 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ services:
-c 'mkdir -p /export/adventureworks && minio server /export --console-address :9001'
healthcheck:
test: timeout 5s bash -c ':> /dev/tcp/127.0.0.1/9000' || exit 1
start_period: 5s
interval: 10s
timeout: 5s
retries: 2
Expand Down Expand Up @@ -54,6 +53,11 @@ services:
- ./playground:/var/lib/playground
image: "greenmask/greenmask:latest"
working_dir: /var/lib/playground
environment:
PGPASSWORD: example
ORIGINAL_DB_NAME: "original"
TRANSFORMED_DB_NAME: "transformed"
DATABASE_HOST: "playground-db"
depends_on:
playground-dbs-filler:
condition: service_completed_successfully
Expand All @@ -68,6 +72,11 @@ services:
build:
dockerfile: docker/greenmask/Dockerfile
context: ./
environment:
PGPASSWORD: example
ORIGINAL_DB_NAME: "original"
TRANSFORMED_DB_NAME: "transformed"
DATABASE_HOST: "playground-db"
depends_on:
playground-dbs-filler:
condition: service_completed_successfully
Expand Down
6 changes: 3 additions & 3 deletions playground/cleanup.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

if psql -lqt -p 5432 -h db -U postgres | cut -d \| -f 1 | grep -qw $TRANSFORMED_DB_NAME; then
psql -p 5432 -h db -U postgres -c "DROP DATABASE $TRANSFORMED_DB_NAME;"
psql -p 5432 -h db -U postgres -c "CREATE DATABASE $TRANSFORMED_DB_NAME;"
if psql -lqt -p 5432 -h $DATABASE_HOST -U postgres | cut -d \| -f 1 | grep -qw $TRANSFORMED_DB_NAME; then
psql -p 5432 -h $DATABASE_HOST -U postgres -c "DROP DATABASE $TRANSFORMED_DB_NAME;"
psql -p 5432 -h $DATABASE_HOST -U postgres -c "CREATE DATABASE $TRANSFORMED_DB_NAME;"
fi

0 comments on commit f142730

Please sign in to comment.