github.com/dnephin/dobi@v0.15.0/examples/init-db-with-rails/test.sh (about)

     1  #!/usr/bin/env bash
     2  # SUMMARY: Test initialize a database
     3  # LABELS: never
     4  # REPEAT:
     5  # AUTHOR:
     6  set -eu -o pipefail
     7  
     8  cleanup() {
     9      echo "running cleanup"
    10      rm db/export.sql
    11      dobi autoclean
    12  }
    13  trap "cleanup" EXIT
    14  
    15  dobi dev-environment
    16  
    17  echo "image=rails creates an image with two tags"
    18  docker inspect --type image \
    19      example/web:examplerailsdb \
    20      example/web:examplerailsdb-root
    21  
    22  echo "compose=empty-db-env creates a container"
    23  docker inspect --type container examplerailsdbexport_postgres_1
    24  
    25  echo "job=export-models creates db/export.sql"
    26  ls db/export.sql
    27  
    28  echo "image=database-img creates an image with two tags"
    29  docker inspect --type image \
    30      example/database:examplerailsdb \
    31      example/database:examplerailsdb-root