build.sh has been superseded by Makefile.
[arvados.git] / docker / Makefile
1 all: api-image doc-image workbench-image warehouse-image sso-image
2
3 clean:
4         -rm *-image */generated/*
5
6 # ============================================================
7 # Dependencies for */generated files which are prerequisites
8 # for building docker images.
9
10 API_DEPS = api/Dockerfile $(API_GENERATED)
11
12 DOC_DEPS = doc/Dockerfile doc/apache2_vhost
13
14 WORKBENCH_DEPS = workbench/Dockerfile \
15                  workbench/passenger.conf \
16                  $(WORKBENCH_GENERATED)
17
18 WAREHOUSE_DEPS = warehouse/Dockerfile \
19                  warehouse/supervisor.conf \
20                  $(WAREHOUSE_GENERATED)
21
22 SSO_DEPS = sso/passenger.conf $(SSO_GENERATED)
23
24 API_GENERATED = \
25         api/generated/apache2_vhost \
26         api/generated/config_databases.sh \
27         api/generated/database.yml \
28         api/generated/omniauth.rb \
29         api/generated/production.rb \
30         api/generated/secret_token.rb
31
32 API_GENERATED_IN = \
33         api/apache2_vhost.in \
34         api/config_databases.sh.in \
35         api/database.yml.in \
36         api/omniauth.rb.in \
37         api/production.rb.in \
38         api/secret_token.rb.in
39
40 WORKBENCH_GENERATED = \
41         workbench/generated/apache2_vhost \
42         workbench/generated/production.rb \
43         workbench/generated/secret_token.rb
44
45 WORKBENCH_GENERATED_IN = \
46         workbench/apache2_vhost.in \
47         workbench/production.rb.in \
48         workbench/secret_token.rb.in
49
50 WAREHOUSE_GENERATED = warehouse/generated/warehouse.conf
51
52 WAREHOUSE_GENERATED_IN = warehouse/warehouse.conf.in
53
54 SSO_GENERATED = \
55         sso/generated/apache2_vhost \
56         sso/generated/seeds.rb \
57         sso/generated/secret_token.rb
58
59 SSO_GENERATED_IN = \
60         sso/apache2_vhost.in \
61         sso/seeds.rb.in \
62         sso/secret_token.rb.in
63
64 $(API_GENERATED): config.yml $(API_GENERATED_IN)
65         ./config.rb
66
67 $(WORKBENCH_GENERATED): config.yml $(WORKBENCH_GENERATED_IN)
68         ./config.rb
69
70 $(WAREHOUSE_GENERATED): config.yml $(WAREHOUSE_GENERATED_IN)
71         ./config.rb
72
73 $(SSO_GENERATED): config.yml $(SSO_GENERATED_IN)
74         ./config.rb
75
76 # ============================================================
77 # The main Arvados servers: api, doc, workbench, warehouse
78
79 api-image: passenger-image $(API_DEPS)
80         mkdir -p api/generated
81         tar -c -z -f api/generated/api.tar.gz -C ../services api
82         ./docker_build -t arvados/api api
83         echo -n "Built at $(date)" > api-image
84
85 doc-image: base-image $(DOC_DEPS)
86         mkdir -p doc/generated
87         tar -c -z -f doc/generated/doc.tar.gz -C .. doc
88         ./docker_build -t arvados/doc doc
89         echo -n "Built at $(date)" > doc-image
90
91 workbench-image: passenger-image $(WORKBENCH_DEPS)
92         mkdir -p workbench/generated
93         tar -c -z -f workbench/generated/workbench.tar.gz -C ../apps workbench
94         ./docker_build -t arvados/workbench workbench
95         echo -n "Built at $(date)" > workbench-image
96
97 warehouse-image: base-image $(WAREHOUSE_DEPS)
98         ./docker_build -t arvados/warehouse warehouse
99         echo -n "Built at $(date)" > warehouse-image
100
101 sso-image: passenger-image $(SSO_DEPS)
102         ./docker_build -t arvados/sso sso
103         echo -n "Built at $(date)" > sso-image
104
105 # ============================================================
106 # The arvados/base image is the base Debian image plus packages
107 # that are dependencies for every Arvados service.
108
109 passenger-image: base-image
110         ./docker_build -t arvados/passenger passenger
111         echo -n "Built at $(date)" > passenger-image
112
113 base-image: debian-image
114         ./docker_build -t arvados/base base
115         echo -n "Built at $(date)" > base-image
116
117 debian-image:
118         ./mkimage-debootstrap.sh arvados/debian wheezy http://debian.lcs.mit.edu/debian/
119         echo -n "Built at $(date)" > debian-image
120