-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.docker
90 lines (68 loc) · 2.84 KB
/
Makefile.docker
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# Bundling all operations related to docker in a single file
default:
@echo no default target
# Starts the dev environment which continously watches the server and client folder
# and rebuilds them on changes.. It may be shut down using ^C in the shell that started
# this target or via the `stop-dev` target from another shell.
run-dev:
docker-compose up db server client
# Resets the development environment by removing all conainers INCLUDING the storage
# volumes.
reset-dev:
docker-compose down -v
run-reset-dev: reset-dev run-dev
# Loads the live data on a running server
exec-dev-load-live-data:
docker-compose exec server su user -c 'make -C server load-live-data'
# Interactively opens a shell on the dev server container. This is useful to run
# maintenance tasks with `rails (located at `server/bin/rails`).
shell-server-dev:
docker-compose exec --user user server /bin/bash
# Interactively opens a shell on the dev client container. This is useful to run
# maintenance tasks with `ng` (located at `client/node_modules/.bin/ng`)
shell-client-dev:
docker-compose exec --user user client /bin/bash
# Stops a running developent environment.
stop-dev:
docker-compose down
# Starts the test environment to run all tests exactly once.
run-test:
docker-compose down -v
docker-compose up --abort-on-container-exit test db
# Locally builds all images that are required for development. You probably want to
# simply pull them.
build-dev: build-server-dev build-client-dev
@echo built development images
# Builds the base image
build-base:
docker-compose build base
# Builds the server image that runs Rails
build-server-dev: build-base
docker-compose build server
# Builds the client image that compiles Angular
build-client-dev: build-base
docker-compose build client
# Builds an image that can run all testcases
build-test: build-base
docker-compose build test
# Builds all images
build-all: build-base build-server-dev build-client-dev build-test
# Pulls all images from the registry
pull-all:
docker-compose pull
# Pushes locally built base image back to the docker hub, requires privileges
push-base:
docker push marcusriemer/blockwerkzeug:base
# Pushes locally built dev images back to the docker hub, requires privileges
push-dev: push-server-dev push-client-dev
# Pushes locally built server dev image back to the docker hub, requires privileges
push-server-dev: push-base
docker push marcusriemer/blockwerkzeug:server-dev
# Pushes locally built client dev image back to the docker hub, requires privileges
push-client-dev: push-base
docker push marcusriemer/blockwerkzeug:client-dev
# Pushes locally built test image back to the docker hub, requires privileges
push-test : push-base
docker push marcusriemer/blockwerkzeug:test
# Pushes all local images to the docker hub, requires privileges
push-all: push-base push-server-dev push-client-dev push-test