28 lines
608 B
Bash
28 lines
608 B
Bash
|
#!/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"
|