Add a little documentation, make self-contained by downloading tools

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2023-03-02 19:10:12 +01:00
parent 18d705f49a
commit 24c1842a27
Signed by: luzifer
GPG key ID: D91C3E91E4CAD6F5
3 changed files with 29 additions and 6 deletions

2
.gitignore vendored
View file

@ -1 +1,3 @@
config.json
envrun_*
yq_*

View file

@ -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

8
README.md Normal file
View file

@ -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`