Seperate the script

This commit is contained in:
dvirlabs 2025-06-23 00:42:54 +03:00
parent 1f19cd8c41
commit ef74907be2
2 changed files with 13 additions and 4 deletions

View File

@ -1,20 +1,25 @@
#!/bin/bash #!/bin/bash
set -e # ✋ Do NOT install tools here — do that in the pipeline or main.sh
# Required tools # ❗ Fail if required env vars are not set
apk add --no-cache git bash curl yq jq : "${GIT_TOKEN:?GIT_TOKEN is not set}"
: "${CLOUDFLARE_API_TOKEN:?CLOUDFLARE_API_TOKEN is not set}"
: "${CLOUDFLARE_ZONE_ID:?CLOUDFLARE_ZONE_ID is not set}"
# Repo Config # Repos
SANDBOX_REPO_URL="https://git.dvirlabs.com/dvirlabs/sandbox.git" SANDBOX_REPO_URL="https://git.dvirlabs.com/dvirlabs/sandbox.git"
INFRA_REPO_URL="https://${GIT_TOKEN}@git.dvirlabs.com/dvirlabs/infra.git" INFRA_REPO_URL="https://${GIT_TOKEN}@git.dvirlabs.com/dvirlabs/infra.git"
# Paths
SANDBOX_CLONE=".tmp-repos/sandbox" SANDBOX_CLONE=".tmp-repos/sandbox"
INFRA_CLONE=".tmp-repos/infra" INFRA_CLONE=".tmp-repos/infra"
# Generated files
GENERATED_FILE="$(pwd)/generated-values/cloudflared-values.yaml" GENERATED_FILE="$(pwd)/generated-values/cloudflared-values.yaml"
ORIGINAL_FILE="$INFRA_CLONE/manifests/cloudflared/values.yaml" ORIGINAL_FILE="$INFRA_CLONE/manifests/cloudflared/values.yaml"
MERGED_FILE="$INFRA_CLONE/manifests/cloudflared/values.yaml" MERGED_FILE="$INFRA_CLONE/manifests/cloudflared/values.yaml"
# Cloudflare API
CLOUDFLARE_API="https://api.cloudflare.com/client/v4" CLOUDFLARE_API="https://api.cloudflare.com/client/v4"
TARGET="b50bbf48-0a2f-47ce-b73e-336b6718318b.cfargotunnel.com" TARGET="b50bbf48-0a2f-47ce-b73e-336b6718318b.cfargotunnel.com"

View File

@ -1,6 +1,10 @@
#!/bin/bash #!/bin/bash
set -e set -e
# Install dependencies (done once here)
apk add --no-cache git bash curl yq jq
# Load config AFTER env is present (from Woodpecker or exported manually)
source automation/config.sh source automation/config.sh
rm -rf .tmp-repos rm -rf .tmp-repos