Refactor build process to clean it up.
This commit is contained in:
27
Makefile
27
Makefile
@@ -1,11 +1,26 @@
|
||||
ignition:
|
||||
$(MAKE) -C flatcar ignition
|
||||
TERRAFORM_ENV=production
|
||||
|
||||
plan:
|
||||
terraform plan -var-file production.tfvars
|
||||
# .dirstamp plus && $@ is like make magic to get this rule
|
||||
# to only run if the contents of all-apps changes
|
||||
app/.dirstamp: all-apps/app.service all-apps/docker-compose.yaml $(wildcard all-apps/lb/*) $(wildcard all-apps/Nextcloud/*) $(wildcard all-apps/wg-easy/*)
|
||||
rm -Rf app/
|
||||
cp -a all-apps app && touch $@
|
||||
|
||||
apply:
|
||||
terraform apply -var-file production.tfvars
|
||||
ignition.json: cl.yaml app/.dirstamp
|
||||
cat cl.yaml | sudo docker run --rm --volume /home/tjhintz/.ssh/id_rsa.pub:/pwd/ssh-keys --volume ${PWD}:/pwd --workdir /pwd -i quay.io/coreos/butane:latest -d /pwd > ignition.json
|
||||
|
||||
plan: ignition.json
|
||||
terraform plan -var-file $(TERRAFORM_ENV).tfvars
|
||||
|
||||
apply: ignition.json
|
||||
terraform apply -var-file $(TERRAFORM_ENV).tfvars
|
||||
|
||||
## to help me remember the command to run to test the config locally
|
||||
testlocalhost:
|
||||
curl -k --resolve localhost:443:146.190.12.129 https://localhost
|
||||
|
||||
flatcarbuild: ignition.json
|
||||
cp --reflink=auto flatcar/flatcar_production_qemu_image.img.fresh flatcar/flatcar_production_qemu_image.img
|
||||
|
||||
flatcarrun:
|
||||
./flatcar/flatcar_production_qemu.sh -i ignition.json
|
||||
|
||||
Reference in New Issue
Block a user