Skip to main content

scripts/deploy/open-ops-pr.sh

Metadata

Indexed Symbols

No indexed functions/methods detected in this file.

Markdown Headings (if applicable)

No markdown headings detected.

Source Preview

#!/usr/bin/env bash
set -euo pipefail

OPS_REPO_PATH=${OPS_REPO_PATH:-ops-repo}
ENV_NAME=${ENV_NAME:-dev}
IMAGE_TAG=${IMAGE_TAG:-${GITHUB_SHA:-local}}
ENGINE_SKU=${ENGINE_SKU:-$(tr -d '[:space:]' < version.txt)}
IMAGE_REPO_BASE=${IMAGE_REPO_BASE:-ghcr.io/${GITHUB_REPOSITORY_OWNER:-local}}

RELEASE_FILE="${OPS_REPO_PATH}/environments/${ENV_NAME}/release.yaml"

if [[ ! -d "${OPS_REPO_PATH}" ]]; then
echo "Missing ops repo path: ${OPS_REPO_PATH}"
exit 1
fi

cat > "${RELEASE_FILE}" <<YAML
env: ${ENV_NAME}
version: ${ENGINE_SKU}
images:
web:
repository: ${IMAGE_REPO_BASE}/web
tag: ${IMAGE_TAG}
gateway:
repository: ${IMAGE_REPO_BASE}/gateway