Replaces shelling out to 'curl' with httpclient library.
[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 BASE_DEPS = base/Dockerfile $(BASE_GENERATED)
11
12 API_DEPS = api/Dockerfile $(API_GENERATED)
13
14 DOC_DEPS = doc/Dockerfile doc/apache2_vhost
15
16 WORKBENCH_DEPS = workbench/Dockerfile \
17                  workbench/passenger.conf \
18                  $(WORKBENCH_GENERATED)
19
20 WAREHOUSE_DEPS = warehouse/Dockerfile \
21                  warehouse/supervisor.conf \
22                  $(WAREHOUSE_GENERATED)
23
24 SSO_DEPS = sso/passenger.conf $(SSO_GENERATED)
25
26 BASE_GENERATED = base/generated
27
28 API_GENERATED = \
29         api/generated/apache2_vhost \
30         api/generated/config_databases.sh \
31         api/generated/database.yml \
32         api/generated/omniauth.rb \
33         api/generated/production.rb \
34         api/generated/secret_token.rb \
35         api/generated/superuser_token
36
37 API_GENERATED_IN = \
38         api/apache2_vhost.in \
39         api/config_databases.sh.in \
40         api/database.yml.in \
41         api/omniauth.rb.in \
42         api/production.rb.in \
43         api/secret_token.rb.in \
44         api/superuser_token.in
45
46 WORKBENCH_GENERATED = \
47         workbench/generated/apache2_vhost \
48         workbench/generated/production.rb \
49         workbench/generated/secret_token.rb
50
51 WORKBENCH_GENERATED_IN = \
52         workbench/apache2_vhost.in \
53         workbench/production.rb.in \
54         workbench/secret_token.rb.in
55
56 WAREHOUSE_GENERATED = warehouse/generated/warehouse.conf
57
58 WAREHOUSE_GENERATED_IN = warehouse/warehouse.conf.in
59
60 SSO_GENERATED = \
61         sso/generated/apache2_vhost \
62         sso/generated/seeds.rb \
63         sso/generated/secret_token.rb
64
65 SSO_GENERATED_IN = \
66         sso/apache2_vhost.in \
67         sso/seeds.rb.in \
68         sso/secret_token.rb.in
69
70 $(BASE_GENERATED): config.yml
71         ./config.rb
72
73 $(API_GENERATED): config.yml $(API_GENERATED_IN)
74         ./config.rb
75
76 $(WORKBENCH_GENERATED): config.yml $(WORKBENCH_GENERATED_IN)
77         ./config.rb
78
79 $(WAREHOUSE_GENERATED): config.yml $(WAREHOUSE_GENERATED_IN)
80         ./config.rb
81
82 $(SSO_GENERATED): config.yml $(SSO_GENERATED_IN)
83         ./config.rb
84
85 # ============================================================
86 # The main Arvados servers: api, doc, workbench, warehouse
87
88 api-image: passenger-image $(API_DEPS)
89         mkdir -p api/generated
90         tar -c -z -f api/generated/api.tar.gz -C ../services api
91         docker build -t arvados/api api
92         echo -n "Built at $(date)" > api-image
93
94 doc-image: base-image $(DOC_DEPS)
95         mkdir -p doc/generated
96         tar -c -z -f doc/generated/doc.tar.gz -C .. doc
97         docker build -t arvados/doc doc
98         echo -n "Built at $(date)" > doc-image
99
100 workbench-image: passenger-image $(WORKBENCH_DEPS)
101         mkdir -p workbench/generated
102         tar -c -z -f workbench/generated/workbench.tar.gz -C ../apps workbench
103         docker build -t arvados/workbench workbench
104         echo -n "Built at $(date)" > workbench-image
105
106 warehouse-image: base-image $(WAREHOUSE_DEPS)
107         docker build -t arvados/warehouse warehouse
108         echo -n "Built at $(date)" > warehouse-image
109
110 sso-image: passenger-image $(SSO_DEPS)
111         docker build -t arvados/sso sso
112         echo -n "Built at $(date)" > sso-image
113
114 # ============================================================
115 # The arvados/base image is the base Debian image plus packages
116 # that are dependencies for every Arvados service.
117
118 passenger-image: base-image
119         docker build -t arvados/passenger passenger
120         echo -n "Built at $(date)" > passenger-image
121
122 base-image: debian-image $(BASE_DEPS)
123         docker build -t arvados/base base
124         echo -n "Built at $(date)" > base-image
125
126 debian-image:
127         ./mkimage-debootstrap.sh arvados/debian wheezy http://debian.lcs.mit.edu/debian/
128         echo -n "Built at $(date)" > debian-image
129