forked from rokibhasansagar/docker_droid-builder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
executable file
·68 lines (52 loc) · 2.03 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
60
61
62
63
64
65
66
67
# Makefile to make it all
IMAGE_NAME := droid-builder-nsjail
DOCKER_USERNAME := fr3akyphantom
# DOCKER_PASSWORD is SECRET
DOCKER_SLUG := $(DOCKER_USERNAME)/$(IMAGE_NAME)
BUILD_DATE := $(shell date -u +"%Y%m%d")
LABELS := \
--label org.label-schema.build-date=$(BUILD_DATE) \
--label org.label-schema.name="Android ROM Builder" \
--label org.label-schema.description="Ubuntu LTS Image Containing All Required Packages Installed For Building Android ROMs or TWRPs" \
--label org.label-schema.url="https://rokibhasansagar.github.io/" \
--label org.label-schema.vcs-ref=$(shell git rev-parse --short HEAD) \
--label org.label-schema.vcs-url=$(shell git remote get-url origin) \
--label org.label-schema.vendor="Rokib Hasan Sagar" \
--label org.label-schema.version='1.2' \
--label org.label-schema.schema-version="1.0"
BUILDFLAGS := \
--rm --force-rm --compress --no-cache=true --pull \
--file Dockerfile \
--tag $(DOCKER_SLUG):$(NAME) \
--build-arg CODENAME=$(NAME) \
--build-arg SHORTCODE="${ID}"
set_qemu :
docker pull multiarch/qemu-user-static:register
docker run --rm --privileged multiarch/qemu-user-static:register --reset
builder :
docker build . $(BUILDFLAGS) $(LABELS)
pusher :
docker push $(DOCKER_SLUG):$(NAME)
snapper :
docker tag $(DOCKER_SLUG):$(NAME) $(DOCKER_SLUG):$(NAME)-$(BUILD_DATE)
docker push $(DOCKER_SLUG):$(NAME)-$(BUILD_DATE)
push_bionic : pusher
docker tag $(DOCKER_SLUG):$(NAME) $(DOCKER_SLUG):latest
docker push $(DOCKER_SLUG):latest
push_focal : pusher
docker tag $(DOCKER_SLUG):$(NAME) $(DOCKER_SLUG):edge
docker push $(DOCKER_SLUG):edge
bionic_worker :
$(MAKE) ID=bionic builder NAME=bionic
$(MAKE) push_bionic snapper NAME=bionic
focal_worker :
$(MAKE) ID=focal builder NAME=focal
$(MAKE) push_focal snapper NAME=focal
test :
docker pull $(DOCKER_SLUG):$(NAME)
docker run --rm -i --name docker_$(NAME) --hostname $(NAME) -c 64 -m 256m \
$(DOCKER_SLUG):$(NAME) bash -c 'cat /etc/os-release'
tester :
$(MAKE) test NAME=bionic
$(MAKE) test NAME=focal
do_all : set_qemu bionic_worker focal_worker