Skip to content

Commit a43cb99

Browse files
authored
Move redundant code to function in Makefile (#6)
1 parent 0c0f98a commit a43cb99

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

Makefile

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,21 @@
1717

1818
.PHONY: all ubuntu1404 ubuntu1604 latest
1919

20+
# Build docker tag based on provided info
21+
#
22+
# $1: tag_name
23+
# $2: directory_name
24+
define build_tag
25+
docker build -t khos2ow/cloudstack-deb-builder:$(1) $(2)
26+
endef
27+
2028
all: ubuntu1404 ubuntu1604 latest
2129

2230
ubuntu1404:
23-
docker build -t khos2ow/cloudstack-deb-builder:ubuntu1404 ubuntu1404/
31+
$(call build_tag,ubuntu1404,ubuntu1404)
2432

2533
ubuntu1604:
26-
docker build -t khos2ow/cloudstack-deb-builder:ubuntu1604 ubuntu1604/
34+
$(call build_tag,ubuntu1604,ubuntu1604)
2735

2836
latest:
29-
docker build -t khos2ow/cloudstack-deb-builder:latest ubuntu1604/
37+
$(call build_tag,latest,ubuntu1604)

0 commit comments

Comments
 (0)