-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
59 lines (47 loc) · 2.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
COREBUILD_NAME = corebuild
MW_COREBUILD_001 = httpd-php
MW_COREBUILD_002 = httpd-ruby
APPLICATION_BUILD_NAME = wordpress
REGISTRY_SERVER=""
USERNAME=""
PASSWORD=""
VERSION = 1.0.0
REGISTRY = 10.0.1.1
all: build
build: $(COREBUILD_NAME).o $(MW_COREBUILD_001).o $(MW_COREBUILD_002).o $(APPLICATION_BUILD_NAME).o
$(COREBUILD_NAME).o: $(COREBUILD_NAME)/*
podman build -t $(COREBUILD_NAME) $(COREBUILD_NAME)/
@if podman images $(COREBUILD_NAME) | grep $(COREBUILD_NAME); then touch $(COREBUILD_NAME).o; fi
$(MW_COREBUILD_001).o: $(MW_COREBUILD_001)/* $(COREBUILD_NAME).o
podman build -t $(MW_COREBUILD_001) $(MW_COREBUILD_001)/
@if podman images $(MW_COREBUILD_001) | grep $(MW_COREBUILD_001); then touch $(MW_COREBUILD_001).o; fi
$(MW_COREBUILD_002).o: $(MW_COREBUILD_002)/* $(COREBUILD_NAME).o
podman build -t $(MW_COREBUILD_002) $(MW_COREBUILD_002)/
@if podman images $(MW_COREBUILD_002) | grep $(MW_COREBUILD_002); then touch $(MW_COREBUILD_002).o; fi
$(APPLICATION_BUILD_NAME).o: $(APPLICATION_BUILD_NAME)/* $(MW_COREBUILD_001).o
podman build -t $(APPLICATION_BUILD_NAME) $(APPLICATION_BUILD_NAME)/
@if podman images $(APPLICATION_BUILD_NAME) | grep $(APPLICATION_BUILD_NAME); then touch $(APPLICATION_BUILD_NAME).o; fi
test:
env NAME=$(NAME) VERSION=$(VERSION) ./test.sh
clean:
rm ./*.o
tag:
podman tag $(COREBUILD_NAME) $(REGISTRY_SERVER)/$(COREBUILD_NAME)
podman tag $(MW_COREBUILD_001) $(REGISTRY_SERVER)/$(MW_COREBUILD_001)
podman tag $(MW_COREBUILD_002) $(REGISTRY_SERVER)/$(MW_COREBUILD_002)
podman tag $(APPLICATION_BUILD_NAME) $(REGISTRY_SERVER)/$(APPLICATION_BUILD_NAME):latest
tag_production:
podman tag $(COREBUILD_NAME):latest $(COREBUILD_NAME):production
podman tag $(MW_COREBUILD_001):latest $(MW_COREBUILD_001):production
podman tag $(MW_COREBUILD_002):latest $(MW_COREBUILD_002):production
podman tag $(APPLICATION_BUILD_NAME):latest $(APPLICATION_BUILD_NAME):production
tag_registry:
podman tag $(COREBUILD_NAME) $(REGISTRY_SERVER)/$(COREBUILD_NAME)
podman tag $(MW_COREBUILD_001) $(REGISTRY_SERVER)/$(MW_COREBUILD_001)
podman tag $(MW_COREBUILD_002) $(REGISTRY_SERVER)/$(MW_COREBUILD_002)
podman tag $(APPLICATION_BUILD_NAME) $(REGISTRY_SERVER)/$(APPLICATION_BUILD_NAME):latest
push:
atomic push -u $(USERNAME) -p $(PASSWORD) $(REGISTRY_SERVER)/$(COREBUILD_NAME):latest
atomic push -u $(USERNAME) -p $(PASSWORD) $(REGISTRY_SERVER)/$(MW_COREBUILD_001):latest
atomic push -u $(USERNAME) -p $(PASSWORD) $(REGISTRY_SERVER)/$(MW_COREBUILD_002):latest
atomic push -u $(USERNAME) -p $(PASSWORD) $(REGISTRY_SERVER)/$(APPLICATION_BUILD_NAME):latest