-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
38 lines (27 loc) · 1.05 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
DEV_REGISTRY ?= registry.drycc.cc
DRYCC_REGISTRY ?= ${DEV_REGISTRY}
IMAGE = "${DRYCC_REGISTRY}"/drycc/base:"${CODENAME}"-"$(shell dpkg --print-architecture)"
BASE_LAYER = "${IMAGE}"-prebuild
WORK_DIR = /workspace/"${CODENAME}"
SHELLCHECK_PREFIX := podman run --rm -v ${CURDIR}:/workdir -w /workdir ${DRYCC_REGISTRY}/drycc/go-dev shellcheck
SHELL_SCRIPTS = $(shell find . -name '*.sh') $(wildcard debootstrap/*/rootfs/*/bin/*) $(wildcard debootstrap/*/rootfs/*/sbin/*)
SHELL=/bin/bash -o pipefail
clean:
@rm -rf "${WORK_DIR}" "${WORK_DIR}".tar.gz
mkimage:
./scripts/mkimage.sh minbase "${CODENAME}"
podman-import:
@podman import ${WORK_DIR}.tar.gz ${BASE_LAYER}
podman-build: mkimage podman-import
@podman build . \
--tag ${IMAGE} \
--build-arg BASE_LAYER=${BASE_LAYER} \
--file Dockerfile
podman-immutable-push: test-style build
@podman push "${IMAGE}"
@echo -e "\\033[32m---> Build image $codename complete, enjoy life...\\033[0m"
build: podman-build
publish: podman-immutable-push
test: test-style
test-style:
${SHELLCHECK_PREFIX} $(SHELL_SCRIPTS)