clank-bootstrapper/clusterapi/pack-image.sh
2022-12-10 22:08:07 +01:00

28 lines
608 B
Bash
Executable File

#!/bin/bash
set -e
. variables.sh
RELEASE_VERSION="1.0.0-beta.10"
TEMPLATE_VERSION=$KUBERNETES_VERSION-ubuntu-22-04-containerd
PROVIDER_OWNER=syself
PROVIDER_REPO=cluster-api-provider-hetzner
OUTPUT_DIR=/tmp/clusterapi
PROVIDER="$PROVIDER_OWNER/$PROVIDER_REPO"
OUTPUT_FILE=output.tar.gz
OUTPUT="$OUTPUT_DIR/$OUTPUT_FILE"
rm -rf "$OUTPUT_DIR" || true
gh release download "v$RELEASE_VERSION" \
-R "$PROVIDER" \
--archive tar.gz \
-O "$OUTPUT"
(cd $OUTPUT_DIR ; tar -xzf "$OUTPUT_FILE")
packer build "$OUTPUT_DIR/$PROVIDER_REPO-$RELEASE_VERSION/templates/node-image/$TEMPLATE_VERSION/image.json"