-
-
Notifications
You must be signed in to change notification settings - Fork 64
Expand file tree
/
Copy pathgraphile-migrate
More file actions
executable file
·25 lines (21 loc) · 899 Bytes
/
graphile-migrate
File metadata and controls
executable file
·25 lines (21 loc) · 899 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash
# A wrapper for running graphile-migrate within a container
# Use
# * -ti --init to allow for CTRL-C to work with `graphile-migrate watch`
# * --user to allow the current user to own any committed migrations
# * Mount $PWD as /migrate for access to graphile-migrate working files
# The following may be added if you run a Postgres container on an internal
# Docker network which isn't accessible from the host where this script runs.
if [[ ${DATABASE_DOCKER_NETWORK} != "" ]] ; then
DOCKER_EXTRA_OPTS="${DOCKER_EXTRA_OPTS} --network ${DATABASE_DOCKER_NETWORK}"
fi
docker run \
-ti --init \
--user "$(id -u):$(id -g)" \
--rm \
--volume "$PWD:/migrate" \
--env DATABASE_URL="${DATABASE_URL}" \
--env SHADOW_DATABASE_URL="${SHADOW_DATABASE_URL}" \
--env ROOT_DATABASE_URL="${ROOT_DATABASE_URL}" \
${DOCKER_EXTRA_OPTS} \
graphile-migrate "$@"