forked from publiclab/mapknitter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
28 lines (24 loc) · 779 Bytes
/
Makefile
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
export COMPOSE_HTTP_TIMEOUT=360
define wait_for_container
@while ! docker-compose logs web | grep "web server started"; do\
echo "Serving Mapknitter";\
sleep 10;\
done;
endef
build:
cp config/database.yml.example config/database.yml
cp config/config.yml.example config/config.yml
cp db/schema.rb.example db/schema.rb
docker-compose build
deploy-container:
docker-compose up -d
$(call wait_for_container)
redeploy-container:
docker-compose down --remove-orphans
docker-compose up --force-recreate -d
$(call wait_for_container)
docker-compose run -e "DISABLE_DATABASE_ENVIRONMENT_CHECK=1" --rm web bash -lc \
"bundle exec rails db:drop && \
bundle exec rails db:create && \
bundle exec rails db:schema:load && \
bundle exec rails db:migrate"