parameterize channel
diff --git a/cloud_build/flutter_agy_docker/orchestrator.yaml b/cloud_build/flutter_agy_docker/orchestrator.yaml index 2d6c92b..92ee10e 100644 --- a/cloud_build/flutter_agy_docker/orchestrator.yaml +++ b/cloud_build/flutter_agy_docker/orchestrator.yaml
@@ -11,22 +11,23 @@ - | set -euo pipefail - echo "Fetching Flutter release data..." + echo "Fetching Flutter release data for channel: $_CHANNEL..." - # 1. Fetch latest stable version + # 1. Fetch latest version for the specified channel (stable or beta) # The -f flag on curl ensures it fails on HTTP errors. + # We pass the Cloud Build substitution $_CHANNEL as an argument to jq. FLUTTER_VERSION=$$(curl -sf https://storage.googleapis.com/flutter_infra_release/releases/releases_linux.json | \ - jq -r '.current_release.stable as $$stable_hash | .releases[] | select(.hash == $$stable_hash) | .version') + jq -r --arg channel "$_CHANNEL" '.current_release[$$channel] as $$hash | .releases[] | select(.hash == $$hash) | .version') # Validate that the version was successfully parsed. # -z "$$FLUTTER_VERSION" checks if the variable is an empty string (e.g., if jq failed entirely). # "$$FLUTTER_VERSION" == "null" checks if jq succeeded but couldn't find the requested data in the JSON. if [ -z "$$FLUTTER_VERSION" ] || [ "$$FLUTTER_VERSION" == "null" ]; then - echo "Error: Failed to parse stable Flutter version from JSON." + echo "Error: Failed to parse $_CHANNEL Flutter version from JSON." exit 1 fi - echo "Found Flutter version: $$FLUTTER_VERSION" + echo "Found $_CHANNEL Flutter version: $$FLUTTER_VERSION" # 2. Trigger the target build with the version as a substitution # Note: We use --region=global as found in your trigger description @@ -34,3 +35,6 @@ --region=global \ --branch=main \ --substitutions=_FLUTTER_VERSION="$$FLUTTER_VERSION" + +substitutions: + _CHANNEL: "stable"