talos/Makefile

122 lines
3.0 KiB
Makefile
Raw Normal View History

2018-12-19 22:22:05 -08:00
SHA := $(shell gitmeta git sha)
TAG := $(shell gitmeta image tag)
BUILT := $(shell gitmeta built)
COMMON_APP_ARGS := -f ./Dockerfile --build-arg TOOLCHAIN_VERSION=bfdccf2 --build-arg KERNEL_VERSION=65ec2e6 --build-arg GOLANG_VERSION=1.11.4 --build-arg SHA=$(SHA) --build-arg TAG=$(TAG) .
2018-12-19 22:22:05 -08:00
export DOCKER_BUILDKIT := 1
all: enforce rootfs initramfs osctl test docs installer
2018-12-19 22:22:05 -08:00
enforce:
@docker run --rm -it -v $(PWD):/src -w /src autonomy/conform:latest
2018-12-19 22:22:05 -08:00
common:
@docker build \
-t autonomy/$@:$(TAG) \
--target=$@ \
$(COMMON_APP_ARGS)
2018-12-19 22:22:05 -08:00
osd:
@docker build \
-t autonomy/$@:$(TAG) \
2018-12-19 22:22:05 -08:00
--target=$@ \
$(COMMON_APP_ARGS)
osctl:
@docker build \
-t autonomy/$@:$(TAG) \
2018-12-19 22:22:05 -08:00
--target=$@ \
$(COMMON_APP_ARGS)
@docker run --rm -it -v $(PWD)/build:/build autonomy/$@:$(TAG) cp /osctl-linux-amd64 /build
@docker run --rm -it -v $(PWD)/build:/build autonomy/$@:$(TAG) cp /osctl-darwin-amd64 /build
2018-12-19 22:22:05 -08:00
trustd:
@docker build \
-t autonomy/$@:$(TAG) \
2018-12-19 22:22:05 -08:00
--target=$@ \
$(COMMON_APP_ARGS)
proxyd:
@docker build \
-t autonomy/$@:$(TAG) \
2018-12-19 22:22:05 -08:00
--target=$@ \
$(COMMON_APP_ARGS)
blockd:
@docker build \
-t autonomy/$@:$(TAG) \
2018-12-19 22:22:05 -08:00
--target=$@ \
$(COMMON_APP_ARGS)
udevd:
@docker build \
-t autonomy/$@:$(TAG) \
2018-12-19 22:22:05 -08:00
--target=$@ \
$(COMMON_APP_ARGS) \
test:
@docker build \
-t autonomy/$@:$(TAG) \
2018-12-19 22:22:05 -08:00
--target=$@ \
$(COMMON_APP_ARGS)
hyperkube:
@docker pull k8s.gcr.io/$@:v1.13.1
@docker save k8s.gcr.io/$@:v1.13.1 -o ./images/$@.tar
etcd:
@docker pull k8s.gcr.io/$@:3.2.24
@docker save k8s.gcr.io/$@:3.2.24 -o ./images/$@.tar
coredns:
@docker pull k8s.gcr.io/$@:1.2.6
@docker save k8s.gcr.io/$@:1.2.6 -o ./images/$@.tar
pause:
@docker pull k8s.gcr.io/$@:3.1
@docker save k8s.gcr.io/$@:3.1 -o ./images/$@.tar
rootfs: hyperkube etcd coredns pause osd trustd proxyd blockd
@docker save autonomy/osd:$(TAG) -o ./images/osd.tar
@docker save autonomy/trustd:$(TAG) -o ./images/trustd.tar
@docker save autonomy/proxyd:$(TAG) -o ./images/proxyd.tar
@docker save autonomy/blockd:$(TAG) -o ./images/blockd.tar
2018-12-19 22:22:05 -08:00
@docker build \
-t autonomy/$@:$(TAG) \
2018-12-19 22:22:05 -08:00
--target=$@ \
$(COMMON_APP_ARGS)
@docker run --rm -it -v $(PWD)/build:/build autonomy/$@:$(TAG) cp /rootfs.tar.gz /build
2018-12-19 22:22:05 -08:00
initramfs:
@docker build \
-t autonomy/$@:$(TAG) \
2018-12-19 22:22:05 -08:00
--target=$@ \
$(COMMON_APP_ARGS)
@docker run --rm -it -v $(PWD)/build:/build autonomy/$@:$(TAG) cp /initramfs.xz /build
2018-12-19 22:22:05 -08:00
.PHONY: docs
docs:
@docker build \
-t autonomy/$@:$(TAG) \
2018-12-19 22:22:05 -08:00
--target=$@ \
$(COMMON_APP_ARGS)
@rm -rf ./docs
@docker run --rm -it -v $(PWD):/out autonomy/$@:$(TAG) cp -R /docs /out
2018-12-19 22:22:05 -08:00
installer:
2018-12-19 22:22:05 -08:00
@docker build \
-t autonomy/talos:$(TAG) \
2018-12-19 22:22:05 -08:00
--target=$@ \
$(COMMON_APP_ARGS)
@docker run --rm -it -v $(PWD)/build:/build autonomy/talos:$(TAG) cp /generated/boot/vmlinuz /build
@docker run --rm -it -v /dev:/dev -v $(PWD)/build:/out --privileged autonomy/talos:$(TAG) image -l
2018-12-19 22:22:05 -08:00
deps:
@GO111MODULES=on CGO_ENABLED=0 go get -u github.com/autonomy/gitmeta
@GO111MODULES=on CGO_ENABLED=0 go get -u github.com/autonomy/conform
clean:
go clean -modcache
rm -rf build vendor