-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
174 lines (150 loc) · 7.54 KB
/
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
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
init:
git clone https://github.com/o2r-project/reference-implementation
cd reference-implementation
git submodule add https://github.com/o2r-project/api
git submodule add https://github.com/o2r-project/architecture
git submodule add https://github.com/o2r-project/containerit
git submodule add https://github.com/o2r-project/erc-spec
git submodule add https://github.com/o2r-project/erc-checker
git submodule add https://github.com/o2r-project/erc-examples
git submodule add https://github.com/o2r-project/o2r-bouncer
git submodule add https://github.com/o2r-project/o2r-finder
git submodule add https://github.com/o2r-project/o2r-informer
git submodule add https://github.com/o2r-project/o2r-inspecter
git submodule add https://github.com/o2r-project/o2r-loader
git submodule add https://github.com/o2r-project/o2r-meta
git submodule add https://github.com/o2r-project/o2r-muncher
git submodule add https://github.com/o2r-project/o2r-platform
git submodule add https://github.com/o2r-project/o2r-shipper
git submodule add https://github.com/o2r-project/o2r-substituter
git submodule add https://github.com/o2r-project/o2r-transporter
git submodule add https://github.com/o2r-project/o2r-guestlister
git submodule add https://github.com/o2r-project/o2r-bindings
git submodule add https://github.com/o2r-project/containerit
update:
git pull
git submodule update --init --recursive --remote
git submodule foreach --recursive git checkout master
git submodule foreach --recursive git pull origin master
local_build:
docker-compose --file docker-compose-local.yml build;
local_up:
docker-compose --file docker-compose-local.yml up;
local_down:
docker-compose --file docker-compose-local.yml down;
local_down_volume:
docker-compose --file docker-compose-local.yml down --volume;
local: update local_build local_up
local_versions:
etc/local_versions.sh
local_versions_save: local_versions
rm -f versions.txt
make local_versions >> versions.txt
hub_images:
# pull ":latest" images so that we don't need to update versions here as well
docker pull o2rproject/o2r-bouncer;
docker pull o2rproject/o2r-finder;
docker pull o2rproject/o2r-informer;
docker pull o2rproject/o2r-inspecter;
docker pull o2rproject/o2r-loader;
docker pull o2rproject/o2r-meta;
docker pull o2rproject/o2r-muncher;
docker pull o2rproject/o2r-platform;
docker pull o2rproject/o2r-shipper;
docker pull o2rproject/o2r-substituter;
docker pull o2rproject/o2r-transporter;
docker pull o2rproject/o2r-guestlister;
docker pull o2rproject/o2r-bindings;
hub_versions:
@docker inspect --format '{{index .Config.Labels "org.label-schema.name"}}: {{index .Config.Labels "org.label-schema.version"}}' o2rproject/o2r-bouncer;
@docker inspect --format '{{index .Config.Labels "org.label-schema.name"}}: {{index .Config.Labels "org.label-schema.version"}}' o2rproject/o2r-finder;
@docker inspect --format '{{index .Config.Labels "org.label-schema.name"}}: {{index .Config.Labels "org.label-schema.version"}}' o2rproject/o2r-informer;
@docker inspect --format '{{index .Config.Labels "org.label-schema.name"}}: {{index .Config.Labels "org.label-schema.version"}}' o2rproject/o2r-inspecter;
@docker inspect --format '{{index .Config.Labels "org.label-schema.name"}}: {{index .Config.Labels "org.label-schema.version"}}' o2rproject/o2r-loader;
@docker inspect --format '{{index .Config.Labels "org.label-schema.name"}}: {{index .Config.Labels "org.label-schema.version"}}' o2rproject/o2r-meta;
@docker inspect --format '{{index .Config.Labels "org.label-schema.name"}}: {{index .Config.Labels "org.label-schema.version"}}' o2rproject/o2r-muncher;
@docker inspect --format '{{index .Config.Labels "org.label-schema.name"}}: {{index .Config.Labels "org.label-schema.version"}}' o2rproject/o2r-platform;
@docker inspect --format '{{index .Config.Labels "org.label-schema.name"}}: {{index .Config.Labels "org.label-schema.vcs-ref"}}' o2rproject/o2r-shipper;
@docker inspect --format '{{index .Config.Labels "org.label-schema.name"}}: {{index .Config.Labels "org.label-schema.version"}}' o2rproject/o2r-substituter;
@docker inspect --format '{{index .Config.Labels "org.label-schema.name"}}: {{index .Config.Labels "org.label-schema.version"}}' o2rproject/o2r-transporter;
@docker inspect --format '{{index .Config.Labels "org.label-schema.name"}}: {{index .Config.Labels "org.label-schema.version"}}' o2rproject/o2r-guestlister;
@docker inspect --format '{{index .Config.Labels "org.label-schema.name"}}: {{index .Config.Labels "org.label-schema.version"}}' o2rproject/o2r-bindings;
@docker inspect --format '{{index .Config.Labels "org.label-schema.name"}}: {{index .Config.Labels "org.label-schema.version"}}' o2rproject/containerit;
hub_up:
docker-compose up;
hub: hub_images hub_versions hub_up
hub_down_volume:
docker-compose down --volume;
hub_clean: hub_down_volume
docker ps -a | grep o2r | awk '{print $$1}' | xargs sh -c "docker rm --force || true"
docker images | grep o2r | awk '{print $$3}' | xargs sh -c "docker rmi --force || true"
local_clean: local_down_volume
docker ps -a | grep o2r | awk '{print $$1}' | xargs sh -c "docker rm --force || true"
docker images | grep o2r_refimpl | awk '{print $$3}' | xargs sh -c "docker rmi --force || true"
build_documentation:
rm -f *.pdf
docker build --tag o2r_refimpl_docbuilder --file etc/Dockerfile.documentations .
docker run -it -v $(CURDIR)/architecture:/doc:rw o2r_refimpl_docbuilder make build pdf
docker run -it -v $(CURDIR)/api:/doc:rw o2r_refimpl_docbuilder make build pdf
docker run -it -v $(CURDIR)/erc-spec:/doc:rw o2r_refimpl_docbuilder make build travis_pdf
mv architecture/site/o2r-architecture.pdf .
mv erc-spec/site/erc-spec.pdf .
mv api/o2r-web-api.pdf .
@echo "ERC, architecture, and web API documentation created, see files PDF files in the project root directory"
local_save_images:
docker save \
mongo:3.6 \
adicom/admin-mongo:latest \
docker.elastic.co/elasticsearch/elasticsearch:5.6.10 \
o2r_refimpl_containerit \
o2r_refimpl_meta \
o2r_refimpl_muncher \
o2r_refimpl_loader \
o2r_refimpl_informer \
o2r_refimpl_bouncer \
o2r_refimpl_finder \
o2r_refimpl_transporter \
o2r_refimpl_shipper \
o2r_refimpl_substituter \
o2r_refimpl_inspecter \
o2r_refimpl_bindings \
o2r_refimpl_guestlister \
o2r_refimpl_platform \
nginx:latest | pigz --stdout --fast > o2r-reference-implementation-images.tar.gz;
ls -1sh o2r-reference-implementation-images*.tar.gz;
#@echo "Inspect tarball manifests with";
#tar -xf o2r-reference-implementation-images.tar.gz manifest.json -O | python -m json.tool;
create_archives:
zip -r -q o2r-reference-implementation-modules.zip containerit/ erc-checker/ o2r-*/;
zip -r -q o2r-docs.zip api/ architecture/ erc-examples/ erc-spec/;
zip -r -q o2r-reference-implementation-files.zip etc/ .env docker-compose*.yml LICENSE versions.txt;
versions:
make --version;
git --version;
docker --version;
docker-compose --version;
pigz --version;
python --version;
unzip --help | head -1;
zip --help | head -2 | tail -1;
package_clean:
rm -f *.zip;
rm -f *.tar;
rm -f *.tar.gz;
package: package_clean \
local_clean \
versions \
update \
build_documentation \
local_versions_save \
local_build \
local_save_images \
create_archives
upload_files_to_zenodo:
python etc/zenodo_upload.py
reproduce:
unzip o2r-docs.zip;
unzip o2r-reference-implementation-modules.zip;
unzip o2r-reference-implementation-files.zip;
docker load --input o2r-reference-implementation-images.tar.gz;
docker-compose --file docker-compose-local.yml --project-name reference-implementation up --no-build;