This repository has been archived by the owner on May 26, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
58 lines (43 loc) · 1.47 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
# Helpers for building and running the welder docker images
# Set IMPORT_PATH to the path of the rpms to import or bind mount to ./rpms/
IMPORT_PATH ?= $(PWD)
GIT_ORG_URL=https://github.com/weldr
REPOS=bdcs bdcs-api welder-web
default: all
repos: $(REPOS)
weld-fedora: Dockerfile-weld
sudo docker build -t welder/fedora:28 --cache-from welder/fedora:latest -f Dockerfile-weld .
sudo docker tag welder/fedora:28 welder/fedora:latest
# given a repo in REPOS, clone it from GIT_ORG_URL
$(REPOS):%:
git clone $(GIT_ORG_URL)/$@
# clone from local copies of repos
local-repos: GIT_ORG_URL=..
local-repos: clean repos
# Build the weld/* docker images. No rpms are imported and no images are run.
build: repos weld-fedora
sudo $(MAKE) -C bdcs importer
sudo docker-compose build
# This uses local checkouts one directory above
build-local: local-repos build
# Import the RPMS from IMPORT_PATH and create the content store volume.
import: repos
@if [ -h $(IMPORT_PATH)/rpms ]; then \
echo "ERROR: $(IMPORT_PATH)/rpms/ cannot be a symlink"; \
exit 1; \
fi; \
if [ ! -d $(IMPORT_PATH)/rpms ]; then \
echo "ERROR: $(IMPORT_PATH)/rpms/ must exist"; \
exit 1; \
fi; \
sudo WORKSPACE=$(IMPORT_PATH) $(MAKE) -C bdcs mddb
run: repos
sudo docker-compose up
run-background: repos
sudo docker-compose up -d
all:
@echo "Try 'make build', 'make import', or 'make run'."
@echo "(make sure Docker is running first!)"
clean:
rm -rf $(REPOS)
.PHONY: clean build import run build-local