From 24c1842a27473bbf0f1dc8fe74c40e4dd88ac354 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Thu, 2 Mar 2023 19:10:12 +0100 Subject: [PATCH] Add a little documentation, make self-contained by downloading tools Signed-off-by: Knut Ahlers --- .gitignore | 2 ++ Makefile | 25 +++++++++++++++++++------ README.md | 8 ++++++++ 3 files changed, 29 insertions(+), 6 deletions(-) create mode 100644 README.md diff --git a/.gitignore b/.gitignore index d344ba6..5a2427d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ config.json +envrun_* +yq_* diff --git a/Makefile b/Makefile index 141d488..3e607e2 100644 --- a/Makefile +++ b/Makefile @@ -1,17 +1,20 @@ -ALPINE_VERSION:=3.17.0 -PACKER_VERSION:=1.8.4-r2 +ALPINE_VERSION:=3.17 +PACKER_VERSION:=1.8.4-r3 ANSIBLE_CORE_VERSION:=2.13.6-r0 JQ_VERSION:=1.6-r2 +ENVRUN_VERSION:=v0.6.2 +YQ_VERSION:=v4.31.2 + export DOCKER_BUILDKIT:=1 default: -config.json: - yq -ojson . config.yaml | jq -S . >config.json +config.json: yq_$(YQ_VERSION) + ./yq_$(YQ_VERSION) -ojson . config.yaml | jq -S . >config.json -create-snapshot: docker-build config.json - envrun -- docker run --rm -i \ +create-snapshot: docker-build config.json envrun_$(ENVRUN_VERSION) + ./envrun_$(ENVRUN_VERSION) -- docker run --rm -i \ -e "HCLOUD_TOKEN" \ -v "$(CURDIR):/config:ro" \ registry.local/alpine-on-hetzner:latest \ @@ -26,4 +29,14 @@ docker-build: -t registry.local/alpine-on-hetzner \ ./alpine-on-hetzner +# --- 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 $@ + .PHONY: config.json diff --git a/README.md b/README.md new file mode 100644 index 0000000..53bbce7 --- /dev/null +++ b/README.md @@ -0,0 +1,8 @@ +# Luzifer / hetzner-alpine-k8s + +This repo contains my configuration for the [MathiasPius/alpine-on-hetzner](https://github.com/MathiasPius/alpine-on-hetzner) build tooling. + +## Usage + +- Create an `.env` file containing an `HCLOUD_TOKEN=someimportanttoken` +- Execute `make create-snapshot`