khuedoan-homelab/Makefile
Khue Doan adbaf32aa5 refactor(tools): switch to Nix
- Nix is more reproducible (pinned to a specific hash)
- Faster rebuild after changing the package list (due to /nix caching in volume)
- Users can still use make tools (wrapped in Docker) without installing Nix
- Using nix-shell will work if you have nix installed.
2022-08-26 19:08:52 +07:00

63 lines
1.0 KiB
Makefile

.POSIX:
.PHONY: *
.EXPORT_ALL_VARIABLES:
KUBECONFIG = $(shell pwd)/metal/kubeconfig.yaml
KUBE_CONFIG_PATH = $(KUBECONFIG)
default: metal bootstrap external wait post-install
configure:
./scripts/configure
git status
metal:
make -C metal
bootstrap:
make -C bootstrap
external:
make -C external
wait:
./scripts/wait-main-apps
post-install:
@./scripts/hacks
tools:
@docker run \
--rm \
--interactive \
--tty \
--network host \
--env "KUBECONFIG=${KUBECONFIG}" \
--volume "/var/run/docker.sock:/var/run/docker.sock" \
--volume $(shell pwd):$(shell pwd) \
--volume ${HOME}/.ssh:/root/.ssh \
--volume ${HOME}/.terraform.d:/root/.terraform.d \
--volume homelab-tools-cache:/root/.cache \
--volume homelab-tools-nix:/nix \
--workdir $(shell pwd) \
nixos/nix nix-shell
test:
make -C test
dev:
make -C metal cluster env=dev
make -C bootstrap
docs:
docker run \
--rm \
--interactive \
--tty \
--publish 8000:8000 \
--volume $(shell pwd):/docs \
squidfunk/mkdocs-material
git-hooks:
pre-commit install