Skip to content

Commit

Permalink
feature/#24-arm64-support makefile refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
PlugFox committed Jul 14, 2022
1 parent 0031a93 commit d498f44
Show file tree
Hide file tree
Showing 12 changed files with 132 additions and 125 deletions.
129 changes: 4 additions & 125 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,130 +1,9 @@
-include *.mk
.PHONY: help

.PHONY: all build push shell prune scan demo

all:
@echo Вы можете использовать: build, push, shell
help:
@echo You can user commands: build, push, shell
@echo make build FLUTTER_CHANNEL="stable"
@echo make push FLUTTER_CHANNEL="stable"
@echo make shell FLUTTER_CHANNEL="stable"

# Build images for channel or version
# Running with argument FLUTTER_CHANNEL or FLUTTER_VERSION
# make build FLUTTER_CHANNEL="<КАНАЛ>" e.g. make build FLUTTER_CHANNEL="stable"
# make build FLUTTER_VERSION="<ВЕРСИЯ>" e.g. make build FLUTTER_VERSION="2.5.3"
build:
ifdef FLUTTER_CHANNEL
@echo "BUILD FLUTTER CHANNEL $(FLUTTER_CHANNEL)"
@docker build --no-cache --force-rm --compress \
--file ./dockerfiles/flutter.dockerfile \
--build-arg FLUTTER_CHANNEL=$(FLUTTER_CHANNEL) \
--tag plugfox/flutter:$(FLUTTER_CHANNEL) .
@docker build --no-cache --force-rm --compress \
--file ./dockerfiles/flutter_web.dockerfile \
--build-arg FLUTTER_CHANNEL=$(FLUTTER_CHANNEL) \
--tag "plugfox/flutter:$(FLUTTER_CHANNEL)-web" .
@docker build --no-cache --force-rm --compress \
--file ./dockerfiles/flutter_android.dockerfile \
--build-arg FLUTTER_CHANNEL=$(FLUTTER_CHANNEL) \
--tag "plugfox/flutter:$(FLUTTER_CHANNEL)-android" .
@docker build --no-cache --force-rm --compress \
--file ./dockerfiles/flutter_android_warmed.dockerfile \
--build-arg FLUTTER_CHANNEL=$(FLUTTER_CHANNEL) \
--tag "plugfox/flutter:$(FLUTTER_CHANNEL)-android-warmed" .
endif
ifdef FLUTTER_VERSION
@echo "BUILD FLUTTER VERSION $(FLUTTER_VERSION)"
@docker build --no-cache --force-rm --compress \
--file ./dockerfiles/flutter.dockerfile \
--build-arg FLUTTER_VERSION=$(FLUTTER_VERSION) \
--tag plugfox/flutter:$(FLUTTER_VERSION) .
@docker build --no-cache --force-rm --compress \
--file ./dockerfiles/flutter_web.dockerfile \
--build-arg FLUTTER_VERSION=$(FLUTTER_VERSION) \
--tag "plugfox/flutter:$(FLUTTER_VERSION)-web" .
@docker build --no-cache --force-rm --compress \
--file ./dockerfiles/flutter_android.dockerfile \
--build-arg FLUTTER_VERSION=$(FLUTTER_VERSION) \
--tag "plugfox/flutter:$(FLUTTER_VERSION)-android" .
@docker build --no-cache --force-rm --compress \
--file ./dockerfiles/flutter_android_warmed.dockerfile \
--build-arg FLUTTER_VERSION=$(FLUTTER_VERSION) \
--tag "plugfox/flutter:$(FLUTTER_VERSION)-android-warmed" .
endif

# Push image
# Running with argument FLUTTER_CHANNEL or FLUTTER_VERSION
# make push FLUTTER_CHANNEL="<КАНАЛ>" e.g. make push FLUTTER_CHANNEL="stable"
# make push FLUTTER_VERSION="<ВЕРСИЯ>" e.g. make push FLUTTER_VERSION="2.5.3"
push:
ifdef FLUTTER_CHANNEL
@echo "PUSH FLUTTER $(FLUTTER_CHANNEL)"
@docker push plugfox/flutter:$(FLUTTER_CHANNEL)
@docker push plugfox/flutter:$(FLUTTER_CHANNEL)-web
@docker push plugfox/flutter:$(FLUTTER_CHANNEL)-android
@docker push plugfox/flutter:$(FLUTTER_CHANNEL)-android-warmed
endif
ifdef FLUTTER_VERSION
@echo "PUSH FLUTTER $(FLUTTER_VERSION)"
@docker push plugfox/flutter:$(FLUTTER_VERSION)
@docker push plugfox/flutter:$(FLUTTER_VERSION)-web
@docker push plugfox/flutter:$(FLUTTER_VERSION)-android
@docker push plugfox/flutter:$(FLUTTER_VERSION)-android-warmed
endif

# Get root
# Running with argument FLUTTER_CHANNEL or FLUTTER_VERSION
# make shell FLUTTER_CHANNEL="<КАНАЛ>" e.g. make shell FLUTTER_CHANNEL="stable"
# make shell FLUTTER_VERSION="<ВЕРСИЯ>" e.g. make shell FLUTTER_VERSION="2.5.3"
shell:
ifdef FLUTTER_CHANNEL
@docker run --rm -it -v $(shell pwd):/home --workdir /home \
--user=root:root \
--name flutter_$(FLUTTER_CHANNEL)_android_warmed \
plugfox/flutter:$(FLUTTER_CHANNEL)-android-warmed /bin/bash
endif
ifdef FLUTTER_VERSION
@docker run --rm -it -v $(shell pwd):/home --workdir /home \
--user=root:root \
--name flutter_$(FLUTTER_VERSION)_android_warmed \
plugfox/flutter:$(FLUTTER_VERSION)-android-warmed /bin/bash
endif

# Authentication at docker registry
login:
@docker login

# Clear all
# family=plugfox/flutter
prune:
@docker image prune -af --filter "label=family=plugfox/flutter"

# Scan images
# Running with argument FLUTTER_CHANNEL or FLUTTER_VERSION
# make scan FLUTTER_CHANNEL="<КАНАЛ>" e.g. make scan FLUTTER_CHANNEL="stable"
# make scan FLUTTER_VERSION="<ВЕРСИЯ>" e.g. make scan FLUTTER_VERSION="2.5.3"
scan:
ifdef FLUTTER_CHANNEL
@docker scan plugfox/flutter:$(FLUTTER_CHANNEL)-android-warmed
endif
ifdef FLUTTER_VERSION
@docker scan plugfox/flutter:$(FLUTTER_VERSION)-android-warmed
endif

# Check image
# Running with argument FLUTTER_CHANNEL or FLUTTER_VERSION
# make demo FLUTTER_CHANNEL="<КАНАЛ>" e.g. make demo FLUTTER_CHANNEL="stable"
# make demo FLUTTER_VERSION="<ВЕРСИЯ>" e.g. make demo FLUTTER_VERSION="2.5.3"
demo:
ifdef FLUTTER_CHANNEL
@docker run --rm -it -v $(shell pwd)/tools:/home/tools --workdir /home/tools \
--user=root:root \
--name flutter_$(FLUTTER_CHANNEL)_android_warmed \
plugfox/flutter:$(FLUTTER_CHANNEL)-android-warmed sh /home/tools/build_demo_android.sh
endif
ifdef FLUTTER_VERSION
@docker run --rm -it -v $(shell pwd)/tools:/home/tools --workdir /home/tools \
--user=root:root \
--name flutter_$(FLUTTER_VERSION)_android_warmed \
plugfox/flutter:$(FLUTTER_VERSION)-android-warmed sh /home/tools/build_demo_android.sh
endif
-include tool/makefile/*.mk
Binary file added assets/glibc/arm/glibc-2.30-r0.apk
Binary file not shown.
Binary file added assets/glibc/arm/glibc-bin-2.30-r0.apk
Binary file not shown.
Binary file added assets/glibc/x64/glibc-2.29-r0.apk
Binary file not shown.
Binary file added assets/glibc/x64/glibc-bin-2.29-r0.apk
Binary file not shown.
45 changes: 45 additions & 0 deletions tools/makefile/build.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
.PHONY: build

# Build images for channel or version
# Running with argument FLUTTER_CHANNEL or FLUTTER_VERSION
# make build FLUTTER_CHANNEL="<КАНАЛ>" e.g. make build FLUTTER_CHANNEL="stable"
# make build FLUTTER_VERSION="<ВЕРСИЯ>" e.g. make build FLUTTER_VERSION="2.5.3"
build:
ifdef FLUTTER_CHANNEL
@echo "BUILD FLUTTER CHANNEL $(FLUTTER_CHANNEL)"
@docker build --no-cache --force-rm --compress \
--file ./dockerfiles/flutter.dockerfile \
--build-arg FLUTTER_CHANNEL=$(FLUTTER_CHANNEL) \
--tag plugfox/flutter:$(FLUTTER_CHANNEL) .
@docker build --no-cache --force-rm --compress \
--file ./dockerfiles/flutter_web.dockerfile \
--build-arg FLUTTER_CHANNEL=$(FLUTTER_CHANNEL) \
--tag "plugfox/flutter:$(FLUTTER_CHANNEL)-web" .
@docker build --no-cache --force-rm --compress \
--file ./dockerfiles/flutter_android.dockerfile \
--build-arg FLUTTER_CHANNEL=$(FLUTTER_CHANNEL) \
--tag "plugfox/flutter:$(FLUTTER_CHANNEL)-android" .
@docker build --no-cache --force-rm --compress \
--file ./dockerfiles/flutter_android_warmed.dockerfile \
--build-arg FLUTTER_CHANNEL=$(FLUTTER_CHANNEL) \
--tag "plugfox/flutter:$(FLUTTER_CHANNEL)-android-warmed" .
endif
ifdef FLUTTER_VERSION
@echo "BUILD FLUTTER VERSION $(FLUTTER_VERSION)"
@docker build --no-cache --force-rm --compress \
--file ./dockerfiles/flutter.dockerfile \
--build-arg FLUTTER_VERSION=$(FLUTTER_VERSION) \
--tag plugfox/flutter:$(FLUTTER_VERSION) .
@docker build --no-cache --force-rm --compress \
--file ./dockerfiles/flutter_web.dockerfile \
--build-arg FLUTTER_VERSION=$(FLUTTER_VERSION) \
--tag "plugfox/flutter:$(FLUTTER_VERSION)-web" .
@docker build --no-cache --force-rm --compress \
--file ./dockerfiles/flutter_android.dockerfile \
--build-arg FLUTTER_VERSION=$(FLUTTER_VERSION) \
--tag "plugfox/flutter:$(FLUTTER_VERSION)-android" .
@docker build --no-cache --force-rm --compress \
--file ./dockerfiles/flutter_android_warmed.dockerfile \
--build-arg FLUTTER_VERSION=$(FLUTTER_VERSION) \
--tag "plugfox/flutter:$(FLUTTER_VERSION)-android-warmed" .
endif
19 changes: 19 additions & 0 deletions tools/makefile/demo.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.PHONY: check

# Check image
# Running with argument FLUTTER_CHANNEL or FLUTTER_VERSION
# make demo FLUTTER_CHANNEL="<КАНАЛ>" e.g. make demo FLUTTER_CHANNEL="stable"
# make demo FLUTTER_VERSION="<ВЕРСИЯ>" e.g. make demo FLUTTER_VERSION="2.5.3"
check:
ifdef FLUTTER_CHANNEL
@docker run --rm -it -v $(shell pwd)/tools:/home/tools --workdir /home/tools \
--user=root:root \
--name flutter_$(FLUTTER_CHANNEL)_android_warmed \
plugfox/flutter:$(FLUTTER_CHANNEL)-android-warmed sh /home/tools/build_demo_android.sh
endif
ifdef FLUTTER_VERSION
@docker run --rm -it -v $(shell pwd)/tools:/home/tools --workdir /home/tools \
--user=root:root \
--name flutter_$(FLUTTER_VERSION)_android_warmed \
plugfox/flutter:$(FLUTTER_VERSION)-android-warmed sh /home/tools/build_demo_android.sh
endif
5 changes: 5 additions & 0 deletions tools/makefile/login.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.PHONY: login

# Authentication at docker registry
login:
@docker login
6 changes: 6 additions & 0 deletions tools/makefile/prune.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.PHONY: prune

# Clear all
# family=plugfox/flutter
prune:
@docker image prune -af --filter "label=family=plugfox/flutter"
21 changes: 21 additions & 0 deletions tools/makefile/push.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.PHONY: push

# Push image
# Running with argument FLUTTER_CHANNEL or FLUTTER_VERSION
# make push FLUTTER_CHANNEL="<КАНАЛ>" e.g. make push FLUTTER_CHANNEL="stable"
# make push FLUTTER_VERSION="<ВЕРСИЯ>" e.g. make push FLUTTER_VERSION="2.5.3"
push:
ifdef FLUTTER_CHANNEL
@echo "PUSH FLUTTER $(FLUTTER_CHANNEL)"
@docker push plugfox/flutter:$(FLUTTER_CHANNEL)
@docker push plugfox/flutter:$(FLUTTER_CHANNEL)-web
@docker push plugfox/flutter:$(FLUTTER_CHANNEL)-android
@docker push plugfox/flutter:$(FLUTTER_CHANNEL)-android-warmed
endif
ifdef FLUTTER_VERSION
@echo "PUSH FLUTTER $(FLUTTER_VERSION)"
@docker push plugfox/flutter:$(FLUTTER_VERSION)
@docker push plugfox/flutter:$(FLUTTER_VERSION)-web
@docker push plugfox/flutter:$(FLUTTER_VERSION)-android
@docker push plugfox/flutter:$(FLUTTER_VERSION)-android-warmed
endif
13 changes: 13 additions & 0 deletions tools/makefile/scan.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.PHONY: scan

# Scan images
# Running with argument FLUTTER_CHANNEL or FLUTTER_VERSION
# make scan FLUTTER_CHANNEL="<КАНАЛ>" e.g. make scan FLUTTER_CHANNEL="stable"
# make scan FLUTTER_VERSION="<ВЕРСИЯ>" e.g. make scan FLUTTER_VERSION="2.5.3"
scan:
ifdef FLUTTER_CHANNEL
@docker scan plugfox/flutter:$(FLUTTER_CHANNEL)-android-warmed
endif
ifdef FLUTTER_VERSION
@docker scan plugfox/flutter:$(FLUTTER_VERSION)-android-warmed
endif
19 changes: 19 additions & 0 deletions tools/makefile/shell.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.PHONY: shell

# Get root
# Running with argument FLUTTER_CHANNEL or FLUTTER_VERSION
# make shell FLUTTER_CHANNEL="<КАНАЛ>" e.g. make shell FLUTTER_CHANNEL="stable"
# make shell FLUTTER_VERSION="<ВЕРСИЯ>" e.g. make shell FLUTTER_VERSION="2.5.3"
shell:
ifdef FLUTTER_CHANNEL
@docker run --rm -it -v $(shell pwd):/home --workdir /home \
--user=root:root \
--name flutter_$(FLUTTER_CHANNEL)_android_warmed \
plugfox/flutter:$(FLUTTER_CHANNEL)-android-warmed /bin/bash
endif
ifdef FLUTTER_VERSION
@docker run --rm -it -v $(shell pwd):/home --workdir /home \
--user=root:root \
--name flutter_$(FLUTTER_VERSION)_android_warmed \
plugfox/flutter:$(FLUTTER_VERSION)-android-warmed /bin/bash
endif

0 comments on commit d498f44

Please sign in to comment.