chore: remove 3 stale scripts/ (superseded by devops/)

- deploy-dev.sh → references deleted k8s/ dir
- package_release.sh → replaced by devops/03_build_and_upload_provider.sh
- publish-docs.sh → replaced by devops/04_build_and_publish_docs.sh
This commit is contained in:
“Naeel”
2026-07-05 10:30:57 +04:00
parent 6a1b243366
commit c2438f50a6
3 changed files with 0 additions and 108 deletions
-9
View File
@@ -1,9 +0,0 @@
#!/usr/bin/env bash
set -euo pipefail
# Create namespace if missing and apply kustomize overlay for dev
kubectl create namespace terra-dev --dry-run=client -o yaml | kubectl apply -f -
kubectl apply -k k8s/overlays/dev
echo "Applied kustomize overlay for terra-dev."
echo "To init terraform backend for dev: terraform init -reconfigure -backend-config=terraform/backend-dev.hcl"
-69
View File
@@ -1,69 +0,0 @@
#!/bin/bash
set -e
# Cleanup
rm -rf build_artifacts
mkdir -p build_artifacts
VERSION="${1:-2.0.1}"
# Function to build and zip
build_and_zip() {
OS=$1
ARCH=$2
echo "Building for $OS/$ARCH..."
BINARY_NAME="terraform-provider-nubes_v${VERSION}"
if [ "$OS" == "windows" ]; then
BINARY_NAME="${BINARY_NAME}.exe"
fi
env CGO_ENABLED=0 GOOS=$OS GOARCH=$ARCH go build -o build_artifacts/${BINARY_NAME} .
cd build_artifacts
ZIP_NAME="terraform-provider-nubes_${VERSION}_${OS}_${ARCH}.zip"
# Zip the binary
if [[ "$OS" == "windows" ]]; then
# For windows, we might need zip to handle the .exe extension properly if we were relying on unix permissions, but zip handles it ok.
# Using python zipfile as 'zip' command was missing earlier
python3 -m zipfile -c $ZIP_NAME $BINARY_NAME
else
# Ensure executable permission
chmod +x $BINARY_NAME
python3 -m zipfile -c $ZIP_NAME $BINARY_NAME
fi
# Remove binary to save space/confusion (optional, but cleaner)
rm $BINARY_NAME
cd ..
}
# Build for all targets
build_and_zip linux amd64
build_and_zip windows amd64
build_and_zip darwin amd64
build_and_zip darwin arm64
echo "Calculating SHA256SUMS..."
cd build_artifacts
sha256sum *.zip > terraform-provider-nubes_${VERSION}_SHA256SUMS
echo "Signing SHA256SUMS..."
# Detached binary signature
gpg --batch --detach-sign --default-key 866FD93D456DCA800F2448413EC4673EB798238A --output terraform-provider-nubes_${VERSION}_SHA256SUMS.sig terraform-provider-nubes_${VERSION}_SHA256SUMS
echo "Uploading to S3..."
# Base S3 path
S3_PATH="registry/terraform-registry/terra.k8c.ru/nubes/nubes/${VERSION}/"
# Upload zips
for f in *.zip; do
mc cp $f $S3_PATH
done
# Upload sums and sig
mc cp terraform-provider-nubes_${VERSION}_SHA256SUMS $S3_PATH
mc cp terraform-provider-nubes_${VERSION}_SHA256SUMS.sig $S3_PATH
echo "Done!"
-30
View File
@@ -1,30 +0,0 @@
#!/usr/bin/env bash
set -euo pipefail
# Usage: publish-docs.sh <site-dir> <registry-host> <namespace> <name> <version>
SITE_DIR=${1:-site}
REGISTRY_HOST=${2:-terra.k8c.ru}
NAMESPACE=${3:-nubes-test}
NAME=${4:-nubes}
VERSION=${5:-dev}
# S3-only variables
ENDPOINT=${S3_ENDPOINT:-}
ACCESS_KEY=${S3_ACCESS_KEY:-}
SECRET_KEY=${S3_SECRET_KEY:-}
if [ -z "$ENDPOINT" ] || [ -z "$ACCESS_KEY" ] || [ -z "$SECRET_KEY" ]; then
echo "Error: S3_ENDPOINT/S3_ACCESS_KEY/S3_SECRET_KEY must be set"
exit 2
fi
MC_ALIAS=registry
mc alias set $MC_ALIAS "$ENDPOINT" "$ACCESS_KEY" "$SECRET_KEY" --api S3v4
TARGET="${MC_ALIAS}/terraform-registry/docs/${NAMESPACE}/${NAME}/${VERSION}/"
# Create target bucket path if needed (mc will create directories implicitly when copying)
mc cp --recursive "$SITE_DIR/" "$TARGET"
# Optionally set public policy
mc policy set public "$TARGET" || true
echo "Published docs to: https://${REGISTRY_HOST}/docs/${NAMESPACE}/${NAME}/${VERSION}/"