-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathdev
executable file
·42 lines (34 loc) · 1.03 KB
/
dev
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env bash
#
# Lucidboard docker-based dev environment starter
#
# 1. Write secret files if they don't already exist
# 2. docker-compose up -d (runs postgres and elixir containers)
# 3. Run fish, a friendly shell
#
# Note that if you have Elixir installed to your system, you may like to run
# only postgres as a container. In this case, `db` can be used instead of
# this script. (`down` will still work.)
#
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
if [ "$1" == "--ql" ]; then
export QL_MODE=1
ARGS="${@:2}"
else
ARGS="$@"
fi
if "$DIR/maybe_create_secret_files"; then
cat << EOF
Elixir development environment initialized!
To install dependencies and set up the database, run the following commanads:
mix deps.get
cd assets; npm install; cd ..
mix ecto.setup
(Or execute these commands with the shortcut - \`setup\`)
EOF
fi
docker-compose \
-p lucidboard_dev \
-f "$DIR/../assets/ops/dev/docker-compose.yml" \
up $ARGS -d && \
docker exec -it lucidboard_dev fish