Rewrite build-targets to build multiple images from repo

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2024-08-21 13:51:13 +02:00
parent fefa09c86e
commit 993b866e60
Signed by: luzifer
SSH key fingerprint: SHA256:/xtE5lCgiRDQr8SLxHMS92ZBlACmATUmF1crK16Ks4E
3 changed files with 3 additions and 5 deletions

View file

@ -8,10 +8,8 @@ YQ := ./yq_$(YQ_VERSION)
default: default:
config.json: $(YQ) build/%.yaml: $(ENVRUN) $(PACKER) $(YQ)
$(YQ) -ojson . config.yaml | jq -S . >config.json $(YQ) -ojson . $*.yaml | jq -S . >config.json
create-snapshot: config.json $(ENVRUN) $(PACKER)
$(PACKER) init alpine.pkr.hcl $(PACKER) init alpine.pkr.hcl
$(ENVRUN) -- $(PACKER) build -var-file=config.json alpine.pkr.hcl $(ENVRUN) -- $(PACKER) build -var-file=config.json alpine.pkr.hcl

View file

@ -7,4 +7,4 @@ It contains a modified version of the packer / ansible setup to create a snapsho
## Usage ## Usage
- Create an `.env` file containing an `HCLOUD_TOKEN=someimportanttoken` - Create an `.env` file containing an `HCLOUD_TOKEN=someimportanttoken`
- Execute `make create-snapshot` - Execute `make build/<your YAML config, i.e. config.yaml>`