Skip to content

Commit

Permalink
Provide image version.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit91 committed Feb 20, 2025
1 parent b7c42ff commit 8a40aa3
Showing 1 changed file with 29 additions and 4 deletions.
33 changes: 29 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ else
DOCKER_COMPOSE_RUN_ARG=--rm
endif

-include .env

.PHONY: up
up: env gen-certs control-plane-bake partition-bake
@chmod 600 files/ssh/id_rsa
Expand Down Expand Up @@ -163,13 +165,36 @@ cleanup-partition:
_privatenet: env
docker compose run $(DOCKER_COMPOSE_RUN_ARG) metalctl network list --name user-private-network | grep user-private-network || docker compose run $(DOCKER_COMPOSE_RUN_ARG) metalctl network allocate --partition mini-lab --project 00000000-0000-0000-0000-000000000001 --name user-private-network

.PHONY: _userdata
_userdata:
$(eval USERDATA := $(shell cat files/ignition.yaml | docker run --rm -i ghcr.io/metal-stack/metal-deployment-base:$$DEPLOYMENT_BASE_IMAGE_TAG ct))

.PHONY: machine
machine: _privatenet
docker compose run $(DOCKER_COMPOSE_RUN_ARG) metalctl machine create --description test --name test --hostname test --project 00000000-0000-0000-0000-000000000001 --partition mini-lab --image $(MACHINE_OS) --size v1-small-x86 --userdata '$(shell cat files/ignition.yaml | docker run --rm -i ghcr.io/metal-stack/metal-deployment-base ct)' --networks $(shell docker compose run $(DOCKER_COMPOSE_RUN_ARG) metalctl network list --name user-private-network -o template --template '{{ .id }}')
machine: _privatenet _userdata
docker compose run $(DOCKER_COMPOSE_RUN_ARG) metalctl machine create \
--description test \
--name test \
--hostname test \
--project 00000000-0000-0000-0000-000000000001 \
--partition mini-lab \
--image $(MACHINE_OS) \
--size v1-small-x86 \
--userdata '$(USERDATA)' \
--networks $(shell docker compose run $(DOCKER_COMPOSE_RUN_ARG) metalctl network list --name user-private-network -o template --template '{{ .id }}')

.PHONY: firewall
firewall: _privatenet
docker compose run $(DOCKER_COMPOSE_RUN_ARG) metalctl firewall create --description fw --name fw --hostname fw --project 00000000-0000-0000-0000-000000000001 --partition mini-lab --image firewall-ubuntu-3.0 --size v1-small-x86 --userdata '$(shell cat files/ignition.yaml | docker run --rm -i ghcr.io/metal-stack/metal-deployment-base ct)' --firewall-rules-file=/tmp/rules.yaml --networks internet-mini-lab,$(shell docker compose run $(DOCKER_COMPOSE_RUN_ARG) metalctl network list --name user-private-network -o template --template '{{ .id }}')
firewall: _privatenet _userdata
docker compose run $(DOCKER_COMPOSE_RUN_ARG) metalctl firewall create \
--description fw \
--name fw \
--hostname fw \
--project 00000000-0000-0000-0000-000000000001 \
--partition mini-lab \
--image firewall-ubuntu-3.0 \
--size v1-small-x86 \
--userdata '$(USERDATA)' \
--firewall-rules-file=/tmp/rules.yaml \
--networks internet-mini-lab,$(shell docker compose run $(DOCKER_COMPOSE_RUN_ARG) metalctl network list --name user-private-network -o template --template '{{ .id }}')

.PHONY: public-ip
public-ip:
Expand Down

0 comments on commit 8a40aa3

Please sign in to comment.