mirror of
https://github.com/immich-app/yucca.git
synced 2026-09-30 13:33:00 +08:00
34 lines
1.3 KiB
Bash
Executable File
34 lines
1.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
#MISE description="Build the vendored JTAF junos-qfx provider into a filesystem mirror + write its terraformrc"
|
|
set -euo pipefail
|
|
ROOT=$(git rev-parse --show-toplevel)
|
|
SRC="$ROOT/tf/providers/terraform-provider-junos-qfx"
|
|
MIRROR="${FABRIC_PROVIDER_MIRROR:-$ROOT/.mise/.fabric-provider-mirror}"
|
|
VER="${FABRIC_PROVIDER_VERSION:-0.0.1}"
|
|
|
|
GOOS=$(go env GOOS); GOARCH=$(go env GOARCH)
|
|
BIN="terraform-provider-junos-qfx_v${VER}"
|
|
|
|
# Build into the unpacked filesystem-mirror layout for both registry hosts
|
|
# (OpenTofu defaults to registry.opentofu.org; Terraform to registry.terraform.io).
|
|
for HOST in registry.opentofu.org registry.terraform.io; do
|
|
DEST="$MIRROR/$HOST/hashicorp/junos-qfx/$VER/${GOOS}_${GOARCH}"
|
|
mkdir -p "$DEST"
|
|
( cd "$SRC" && go build -o "$DEST/$BIN" . )
|
|
done
|
|
|
|
cat > "$ROOT/tf/.terraformrc.fabric" <<EOF
|
|
# Generated by 'mise run fabric:provider-build' — do not edit.
|
|
provider_installation {
|
|
filesystem_mirror {
|
|
path = "$MIRROR"
|
|
include = ["registry.opentofu.org/hashicorp/junos-qfx", "registry.terraform.io/hashicorp/junos-qfx"]
|
|
}
|
|
direct {
|
|
exclude = ["registry.opentofu.org/hashicorp/junos-qfx", "registry.terraform.io/hashicorp/junos-qfx"]
|
|
}
|
|
}
|
|
EOF
|
|
echo "built junos-qfx v$VER (${GOOS}_${GOARCH}) -> $MIRROR"
|
|
echo "wrote filesystem_mirror -> tf/.terraformrc.fabric"
|