diff --git a/README.md b/README.md index 6afaf1b..044c51e 100644 --- a/README.md +++ b/README.md @@ -210,8 +210,10 @@ in the environment automatically, so nothing else is needed to wire them up. Opt `GORULES_OUT` (default `dist`), `GORULES_NAME`, `GORULES_CURRENT`, `GORULES_UNPACK` and `GORULES_DELETE` (both `'false'` by default), and `GORULES_CLI_VERSION`. -The job publishes `RULES_CHANGED`, `RULES_VERSION`, `RULES_RELEASE` and `RULES_SHA256` as a dotenv -report, so later jobs read them as ordinary variables. +The job publishes `RULES_CHANGED`, `RULES_PROJECT`, `RULES_TARGET`, `RULES_VERSION`, +`RULES_RELEASE` and `RULES_SHA256` as a dotenv report, so later jobs read them as ordinary +variables — a deploy job can route on the target (e.g. per-environment buckets) without parsing +anything. ## Azure Pipelines diff --git a/templates/gitlab-ci-pull.yml b/templates/gitlab-ci-pull.yml index 08bf0ff..9520126 100644 --- a/templates/gitlab-ci-pull.yml +++ b/templates/gitlab-ci-pull.yml @@ -49,7 +49,11 @@ set -e if [ "$code" -eq 3 ]; then - echo "RULES_CHANGED=false" > gorules.env + { + echo "RULES_CHANGED=false" + echo "RULES_PROJECT=${GORULES_PROJECT:-}" + echo "RULES_TARGET=${GORULES_TARGET:-main}" + } > gorules.env echo "Target unchanged, nothing downloaded." exit 0 fi @@ -57,6 +61,8 @@ { echo "RULES_CHANGED=true" + echo "RULES_PROJECT=${GORULES_PROJECT:-}" + echo "RULES_TARGET=${GORULES_TARGET:-main}" node -e 'const r=require("./result.json");console.log("RULES_VERSION="+(r.version||""));console.log("RULES_RELEASE="+(r.release||""));console.log("RULES_SHA256="+(r.sha256||""))' } > gorules.env cat gorules.env