2023-03-02 18:10:12 +00:00
|
|
|
ALPINE_VERSION:=3.17
|
|
|
|
PACKER_VERSION:=1.8.4-r3
|
2022-12-17 00:05:27 +00:00
|
|
|
ANSIBLE_CORE_VERSION:=2.13.6-r0
|
|
|
|
JQ_VERSION:=1.6-r2
|
|
|
|
|
2023-03-02 18:10:12 +00:00
|
|
|
ENVRUN_VERSION:=v0.6.2
|
|
|
|
YQ_VERSION:=v4.31.2
|
|
|
|
|
2022-12-17 00:05:27 +00:00
|
|
|
export DOCKER_BUILDKIT:=1
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
2023-03-02 18:10:12 +00:00
|
|
|
config.json: yq_$(YQ_VERSION)
|
|
|
|
./yq_$(YQ_VERSION) -ojson . config.yaml | jq -S . >config.json
|
2022-12-17 00:05:27 +00:00
|
|
|
|
2023-03-02 18:10:12 +00:00
|
|
|
create-snapshot: docker-build config.json envrun_$(ENVRUN_VERSION)
|
|
|
|
./envrun_$(ENVRUN_VERSION) -- docker run --rm -i \
|
2022-12-17 00:05:27 +00:00
|
|
|
-e "HCLOUD_TOKEN" \
|
|
|
|
-v "$(CURDIR):/config:ro" \
|
|
|
|
registry.local/alpine-on-hetzner:latest \
|
|
|
|
/config/config.json
|
|
|
|
|
|
|
|
docker-build:
|
|
|
|
docker build \
|
|
|
|
--build-arg ALPINE_VERSION=$(ALPINE_VERSION) \
|
|
|
|
--build-arg PACKER_VERSION=$(PACKER_VERSION) \
|
|
|
|
--build-arg ANSIBLE_CORE_VERSION=$(ANSIBLE_CORE_VERSION) \
|
|
|
|
--build-arg JQ_VERSION=$(JQ_VERSION) \
|
|
|
|
-t registry.local/alpine-on-hetzner \
|
|
|
|
./alpine-on-hetzner
|
|
|
|
|
2023-03-02 18:10:12 +00:00
|
|
|
# --- Tools
|
|
|
|
|
|
|
|
envrun_$(ENVRUN_VERSION):
|
|
|
|
curl -sSfL "https://github.com/Luzifer/envrun/releases/download/$(ENVRUN_VERSION)/envrun_linux_amd64.tar.gz" | tar -xz
|
|
|
|
mv envrun_linux_amd64 $@
|
|
|
|
|
|
|
|
yq_$(YQ_VERSION):
|
|
|
|
curl -sSfLo $@ "https://github.com/mikefarah/yq/releases/download/$(YQ_VERSION)/yq_linux_amd64"
|
|
|
|
chmod +x $@
|
|
|
|
|
2022-12-17 00:05:27 +00:00
|
|
|
.PHONY: config.json
|