Makefile 620 Bytes
Newer Older
1
2
IMAGE_PREFIX := ${DOCKER_IMAGE_PREFIX}
ifeq ($(IMAGE_PREFIX),)
Markus Frosch's avatar
Markus Frosch committed
3
IMAGE_PREFIX := icinga/raspbian-base/
4
5
6
7
8
9
10
endif

REGISTRY := ${DOCKER_REGISTRY}
ifneq ($(REGISTRY),)
IMAGE_PREFIX := $(REGISTRY)/$(IMAGE_PREFIX)
endif

Markus Frosch's avatar
Markus Frosch committed
11
IMAGE := $(IMAGE_PREFIX)${CI_COMMIT_REF_NAME}
12
13
14
15
16
17
18

.PHONY: all tarball clean

all: build

tarball: rootfs.tar.xz
rootfs.tar.xz:
Markus Frosch's avatar
Markus Frosch committed
19
20
	TARBALL="$@.tmp" ./make-image.sh
	mv "$@.tmp" "$@"
21
22

build: tarball
Markus Frosch's avatar
Markus Frosch committed
23
    cp -av /usr/bin/qemu-arm-static .
24
25
26
27
	docker build --tag "$(IMAGE)" .

push:
	docker push "$(IMAGE)"
Markus Frosch's avatar
Markus Frosch committed
28
29

clean:
30
31
	rm -f *.tar*
	if (docker inspect --type image "$(IMAGE)" >/dev/null 2>&1); then docker rmi "$(IMAGE)"; fi