File tree Expand file tree Collapse file tree 1 file changed +11
-14
lines changed
Expand file tree Collapse file tree 1 file changed +11
-14
lines changed Original file line number Diff line number Diff line change 22REGISTRY ?= k90mirzaei/php
33VERSION ?= latest
44
5- CHANGED_DIRS = $(shell git diff --name-only HEAD~1 HEAD | grep '^fpm-alpine/' | cut -d '/' -f 2 | sort | uniq)
6-
75all : build push
86
9- build : # # Build only changed images
7+ build : # # Build all images
108 - @echo " Building..."
11- - @for dir in $(CHANGED_DIRS ) ; do \
12- if [ -d ./fpm-alpine/$$ dir ]; then \
13- echo " Building image for version $$ dir..." ; \
14- docker build ./fpm-alpine/$$ dir -t $(REGISTRY ) :$$ dir-$(VERSION ) ; \
15- fi \
9+ - @for dir in $(shell find ./fpm-alpine -mindepth 1 -maxdepth 1 -type d) ; do \
10+ version=$$(basename $$dir) ; \
11+ echo " Building image for version $$ version..." ; \
12+ docker build $$ dir -t $(REGISTRY ) :$$ version-$(VERSION ) ; \
1613 done
1714
18- push : # # Push only changed images to GitHub repo
15+ push : # # Push all images to github repo
1916 - @echo " Pushing..."
20- - @for dir in $(CHANGED_DIRS ) ; do \
21- if [ -d ./fpm-alpine/$$ dir ]; then \
22- echo " Pushing image for version $$ dir..." ; \
23- docker push $(REGISTRY ) :$$ dir-$(VERSION ) ; \
24- fi \
17+ - @for dir in $(shell find ./fpm-alpine -mindepth 1 -maxdepth 1 -type d) ; do \
18+ version=$$(basename $$dir) ; \
19+ echo " Pushing image for version $$ version..." ; \
20+ docker push $(REGISTRY ) :$$ version-$(VERSION ) ; \
2521 done
2622
23+
2724help : # # Show makefile helper
2825 - @printf ' \e[1;33m%-6s\e[m' " Makefile available commands"
2926 - @echo ' '
You can’t perform that action at this time.
0 commit comments