forked from opencast/opencast-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
146 lines (138 loc) · 4.93 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
# Copyright 2016 The WWU eLectures Team All rights reserved.
#
# Licensed under the Educational Community License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://opensource.org/licenses/ECL-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
DOCKER_IMAGE_BASE=opencast
DOCKER_TAG=$(shell cat VERSION)
REPO=https://github.com/opencast/opencast.git
BRANCH=$(DOCKER_TAG)
CUSTOM_DOCKER_BUILD_ARGS=
all: lint build test
build: build-allinone build-admin build-adminpresentation build-adminworker build-ingest build-migration build-presentation build-worker build-build
build-allinone:
docker build \
--pull \
--build-arg repo=$(REPO) \
--build-arg branch=$(BRANCH) \
-t $(DOCKER_IMAGE_BASE)/allinone \
-t $(DOCKER_IMAGE_BASE)/allinone:$(DOCKER_TAG) \
$(CUSTOM_DOCKER_BUILD_ARGS) \
Dockerfiles/allinone
build-admin:
docker build \
--pull \
--build-arg repo=$(REPO) \
--build-arg branch=$(BRANCH) \
-t $(DOCKER_IMAGE_BASE)/admin \
-t $(DOCKER_IMAGE_BASE)/admin:$(DOCKER_TAG) \
$(CUSTOM_DOCKER_BUILD_ARGS) \
Dockerfiles/admin
build-adminpresentation:
docker build \
--pull \
--build-arg repo=$(REPO) \
--build-arg branch=$(BRANCH) \
-t $(DOCKER_IMAGE_BASE)/adminpresentation \
-t $(DOCKER_IMAGE_BASE)/adminpresentation:$(DOCKER_TAG) \
$(CUSTOM_DOCKER_BUILD_ARGS) \
Dockerfiles/adminpresentation
build-adminworker:
docker build \
--pull \
--build-arg repo=$(REPO) \
--build-arg branch=$(BRANCH) \
-t $(DOCKER_IMAGE_BASE)/adminworker \
-t $(DOCKER_IMAGE_BASE)/adminworker:$(DOCKER_TAG) \
$(CUSTOM_DOCKER_BUILD_ARGS) \
Dockerfiles/adminworker
build-ingest:
docker build \
--pull \
--build-arg repo=$(REPO) \
--build-arg branch=$(BRANCH) \
-t $(DOCKER_IMAGE_BASE)/ingest \
-t $(DOCKER_IMAGE_BASE)/ingest:$(DOCKER_TAG) \
$(CUSTOM_DOCKER_BUILD_ARGS) \
Dockerfiles/ingest
build-migration:
docker build \
--pull \
--build-arg repo=$(REPO) \
--build-arg branch=$(BRANCH) \
-t $(DOCKER_IMAGE_BASE)/migration \
-t $(DOCKER_IMAGE_BASE)/migration:$(DOCKER_TAG) \
$(CUSTOM_DOCKER_BUILD_ARGS) \
Dockerfiles/migration
build-presentation:
docker build \
--pull \
--build-arg repo=$(REPO) \
--build-arg branch=$(BRANCH) \
-t $(DOCKER_IMAGE_BASE)/presentation \
-t $(DOCKER_IMAGE_BASE)/presentation:$(DOCKER_TAG) \
$(CUSTOM_DOCKER_BUILD_ARGS) \
Dockerfiles/presentation
build-worker:
docker build \
--pull \
--build-arg repo=$(REPO) \
--build-arg branch=$(BRANCH) \
-t $(DOCKER_IMAGE_BASE)/worker \
-t $(DOCKER_IMAGE_BASE)/worker:$(DOCKER_TAG) \
$(CUSTOM_DOCKER_BUILD_ARGS) \
Dockerfiles/worker
build-build:
docker build \
--pull \
--build-arg repo=$(REPO) \
--build-arg branch=$(BRANCH) \
-t $(DOCKER_IMAGE_BASE)/build \
-t $(DOCKER_IMAGE_BASE)/build:$(DOCKER_TAG) \
$(CUSTOM_DOCKER_BUILD_ARGS) \
Dockerfiles/build
.PHONY: build build-allinone build-admin build-adminpresentation build-adminworker build-ingest build-migration build-presentation build-worker build-build
test: test-common test-allinone test-admin test-adminpresentation test-adminworker test-ingest test-migration test-presentation test-worker test-build
test-common:
bats test
test-allinone: build-allinone
test-admin: build-admin
test-adminpresentation: build-adminpresentation
test-adminworker: build-adminworker
test-ingest: build-ingest
test-migration: build-migration
test-presentation: build-presentation
test-worker: build-worker
test-build: build-build
.PHONY: test test-common test-allinone test-admin test-adminpresentation test-adminworker test-ingest test-migration test-presentation test-worker test-build
clean:
-docker rmi $(DOCKER_IMAGE_BASE)/allinone
-docker rmi $(DOCKER_IMAGE_BASE)/admin
-docker rmi $(DOCKER_IMAGE_BASE)/adminworker
-docker rmi $(DOCKER_IMAGE_BASE)/ingest
-docker rmi $(DOCKER_IMAGE_BASE)/migration
-docker rmi $(DOCKER_IMAGE_BASE)/presentation
-docker rmi $(DOCKER_IMAGE_BASE)/worker
-docker rmi $(DOCKER_IMAGE_BASE)/build
-docker rmi $(DOCKER_IMAGE_BASE)/allinone:$(DOCKER_TAG)
-docker rmi $(DOCKER_IMAGE_BASE)/admin:$(DOCKER_TAG)
-docker rmi $(DOCKER_IMAGE_BASE)/adminpresentation:$(DOCKER_TAG)
-docker rmi $(DOCKER_IMAGE_BASE)/adminworker:$(DOCKER_TAG)
-docker rmi $(DOCKER_IMAGE_BASE)/ingest:$(DOCKER_TAG)
-docker rmi $(DOCKER_IMAGE_BASE)/migration:$(DOCKER_TAG)
-docker rmi $(DOCKER_IMAGE_BASE)/presentation:$(DOCKER_TAG)
-docker rmi $(DOCKER_IMAGE_BASE)/worker:$(DOCKER_TAG)
-docker rmi $(DOCKER_IMAGE_BASE)/build:$(DOCKER_TAG)
.PHONY: clean
lint:
cd Dockerfiles/admin/assets && shellcheck --shell=sh --external-sources *.sh ./**/*.sh
cd Dockerfiles/build/assets/bin && shellcheck --shell=sh --external-sources *
.PHONY: lint