Skip to content

Commit

Permalink
feat: unstable
Browse files Browse the repository at this point in the history
  • Loading branch information
loic-roux-404 committed Jun 8, 2024
1 parent 57942d4 commit 5a262b1
Show file tree
Hide file tree
Showing 45 changed files with 1,009 additions and 493 deletions.
52 changes: 26 additions & 26 deletions .terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 13 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,19 @@ bootstrap:
@$(BUILDER_EXEC) echo "Started build environment"

build:
@$(BUILDER_EXEC) nix build .#nixosConfigurations.aarch64-darwin.$(NIXOS_CONFIG) --system aarch64-linux $(ARGS)

build-x86:
@$(BUILDER_EXEC) nix build .#nixosConfigurations.x86_64-darwin.$(NIXOS_CONFIG) --system x86_64-linux $(ARGS)
@nix build .#nixosConfigurations.$(NIXOS_CONFIG) --system aarch64-linux $(ARGS)

#### Terraform

TF_ROOT_DIRS := $(wildcard tf-root-*) .
TF_ROOT_DIRS_DESTROY:=$(addsuffix -destroy, $(TF_ROOT_DIRS))
TF_ROOT_DIRS_INIT:=$(addsuffix -init, $(TF_ROOT_DIRS))
TF_ROOT_DIRS_FMT:=$(addsuffix -fmt, $(TF_ROOT_DIRS))
TF_ROOT_DIRS_VALIDATE:=$(addsuffix -validate, $(TF_ROOT_DIRS))
TF_ROOT_DIRS_DESTROY:=$(addsuffix -destroy,$(TF_ROOT_DIRS))
TF_ROOT_DIRS_CONSOLE:=$(addsuffix -console,$(TF_ROOT_DIRS))
TF_ROOT_DIRS_INIT:=$(addsuffix -init,$(TF_ROOT_DIRS))
TF_ROOT_DIRS_FMT:=$(addsuffix -fmt,$(TF_ROOT_DIRS))
TF_ROOT_DIRS_VALIDATE:=$(addsuffix -validate,$(TF_ROOT_DIRS))

init: $(TF_ROOT_DIRS_INIT) $(TF_ALL_WORKSPACES)
@terraform workspace select $(TF_WORKSPACE)

$(TF_ALL_WORKSPACES):
@terraform workspace new $@ || true
Expand All @@ -39,14 +38,16 @@ $(TF_ROOT_DIRS_INIT):
terraform -chdir=$(DIR) init -upgrade $(ARGS)

$(TF_ROOT_DIRS):
@terraform workspace select $(TF_WORKSPACE)
@terraform -chdir=$@ apply -compact-warnings -auto-approve $(ARGS)

$(TF_ROOT_DIRS_DESTROY):
@terraform workspace select $(TF_WORKSPACE)
@$(eval DIR:=$(subst -destroy,,$@))
@terraform -chdir=$(DIR) destroy -auto-approve $(ARGS)

$(TF_ROOT_DIRS_CONSOLE):
@$(eval DIR:=$(subst -console,,$@))
@terraform -chdir=$(DIR) console $(ARGS)

fmt: $(TF_ROOT_DIRS_FMT)

$(TF_ROOT_DIRS_FMT):
Expand All @@ -60,4 +61,5 @@ $(TF_ROOT_DIRS_VALIDATE):
terraform -chdir=$(DIR) validate -no-color $(ARGS)

.PHONY: fmt validate build build-x86 bootstrap init \
$(TF_ROOT_DIRS) $(TF_ROOT_DIRS_DESTROY) $(TF_ROOT_DIRS_INIT)
$(TF_ROOT_DIRS) $(TF_ROOT_DIRS_DESTROY) $(TF_ROOT_DIRS_INIT) \
$(TF_ROOT_DIRS_CONSOLE) $(TF_ROOT_DIRS_FMT) $(TF_ROOT_DIRS_VALIDATE)
139 changes: 126 additions & 13 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5a262b1

Please sign in to comment.