-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
39 lines (28 loc) · 1.04 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
SHELL:=/usr/bin/env bash
MAKEFLAGS += --no-builtin-rules --no-builtin-variables
TF_CMD:=apply -auto-approve
VARIANT=builder
TESTING_X86_URL=https://github.com/loic-roux-404/kube-paas/releases/download/nixos-testing/nixos.qcow2
TARGET?=initial
#### Nix
BUILDER_EXEC:=
NIXOS_CONFIG:=qcow
ifeq ($(shell uname -s),Darwin)
BUILDER_EXEC:=NIX_CONF_DIR=$(PWD)/bootstrap nix develop .\#builder --command
endif
bootstrap:
@$(BUILDER_EXEC) echo "Started default build environment"
bootstrap-contabo:
@VARIANT=builder-x86 $(BUILDER_EXEC) echo "Started x86 environment"
@echo "Waiting builder to start..."
@sleep 15
nixos-local: bootstrap build
build:
@nix build .#nixosConfigurations.$(TARGET).config.formats.qcow
pull-testing-x86:
@rm -rf result && mkdir result
@wget -q --show-progress -O result/nixos.qcow2 $(TESTING_X86_URL)
TERRAGRUNT_FILES:=$(shell find terragrunt -type d -name '.*' -prune -o -name 'terragrunt.hcl' -exec dirname {} \;)
$(TERRAGRUNT_FILES):
@cd $@ && terragrunt $(TF_CMD)
.PHONY: fmt bootstrap nixos-local trust-ca $(TERRAGRUNT_FILES)