diff --git a/Makefile b/Makefile index 62469f99..8dbcfc43 100644 --- a/Makefile +++ b/Makefile @@ -47,6 +47,20 @@ else DOC_VERSION ?= next endif +# SOURCE_REF: stable git ref written into the displayed `source:` URL of generated docs. +# Decoupled from BRANCH (which fetches content) so that patch releases of the same +# minor don't churn every file's source URL on every release. +# v0 → main (legacy bucket; many 0.x tags share this dir) +# next → main (trunk tracks upstream main) +# vX.Y → release-X.Y (the upstream long-lived branch for that minor) +ifeq ($(DOC_VERSION),v0) + SOURCE_REF ?= main +else ifeq ($(DOC_VERSION),next) + SOURCE_REF ?= main +else + SOURCE_REF ?= release-$(patsubst v%,%,$(DOC_VERSION)) +endif + # App lists (override on the command line: `make update-apps APPS="tenant redis"`) APPS ?= tenant clickhouse foundationdb harbor redis mongodb openbao rabbitmq postgres nats kafka mariadb qdrant K8S ?= kubernetes @@ -64,19 +78,19 @@ SERVICES_DEST_DIR ?= content/en/docs/$(DOC_VERSION)/operations/services init-version init-next release-next download-openapi download-openapi-all serve show-target update-apps: - ./hack/update_apps.sh --apps "$(APPS)" --dest "$(APPS_DEST_DIR)" --branch "$(BRANCH)" + ./hack/update_apps.sh --apps "$(APPS)" --dest "$(APPS_DEST_DIR)" --branch "$(BRANCH)" --source-ref "$(SOURCE_REF)" update-vms: - ./hack/update_apps.sh --apps "$(VMS)" --dest "$(VMS_DEST_DIR)" --branch "$(BRANCH)" + ./hack/update_apps.sh --apps "$(VMS)" --dest "$(VMS_DEST_DIR)" --branch "$(BRANCH)" --source-ref "$(SOURCE_REF)" update-networking: - ./hack/update_apps.sh --apps "$(NETWORKING)" --dest "$(NETWORKING_DEST_DIR)" --branch "$(BRANCH)" + ./hack/update_apps.sh --apps "$(NETWORKING)" --dest "$(NETWORKING_DEST_DIR)" --branch "$(BRANCH)" --source-ref "$(SOURCE_REF)" update-k8s: - ./hack/update_apps.sh --index --apps "$(K8S)" --dest "$(K8S_DEST_DIR)" --branch "$(BRANCH)" + ./hack/update_apps.sh --index --apps "$(K8S)" --dest "$(K8S_DEST_DIR)" --branch "$(BRANCH)" --source-ref "$(SOURCE_REF)" update-services: - ./hack/update_apps.sh --apps "$(SERVICES)" --dest "$(SERVICES_DEST_DIR)" --branch "$(BRANCH)" --pkgdir extra + ./hack/update_apps.sh --apps "$(SERVICES)" --dest "$(SERVICES_DEST_DIR)" --branch "$(BRANCH)" --source-ref "$(SOURCE_REF)" --pkgdir extra update-oss-health: ./hack/update_oss_health.py diff --git a/content/en/docs/v1.0/applications/clickhouse.md b/content/en/docs/v1.0/applications/clickhouse.md index b4cda288..9a0ba856 100644 --- a/content/en/docs/v1.0/applications/clickhouse.md +++ b/content/en/docs/v1.0/applications/clickhouse.md @@ -11,7 +11,7 @@ aliases: diff --git a/content/en/docs/v1.0/applications/foundationdb.md b/content/en/docs/v1.0/applications/foundationdb.md index b8ec2c53..7766f5d9 100644 --- a/content/en/docs/v1.0/applications/foundationdb.md +++ b/content/en/docs/v1.0/applications/foundationdb.md @@ -6,7 +6,7 @@ weight: 50 diff --git a/content/en/docs/v1.0/applications/harbor.md b/content/en/docs/v1.0/applications/harbor.md index 5cfc88e2..f05b24ea 100644 --- a/content/en/docs/v1.0/applications/harbor.md +++ b/content/en/docs/v1.0/applications/harbor.md @@ -7,7 +7,7 @@ weight: 50 diff --git a/content/en/docs/v1.0/applications/kafka.md b/content/en/docs/v1.0/applications/kafka.md index f376c087..2ac9aa69 100644 --- a/content/en/docs/v1.0/applications/kafka.md +++ b/content/en/docs/v1.0/applications/kafka.md @@ -10,7 +10,7 @@ aliases: diff --git a/content/en/docs/v1.0/applications/mariadb.md b/content/en/docs/v1.0/applications/mariadb.md index 8d15d4d1..78c0326d 100644 --- a/content/en/docs/v1.0/applications/mariadb.md +++ b/content/en/docs/v1.0/applications/mariadb.md @@ -10,7 +10,7 @@ aliases: diff --git a/content/en/docs/v1.0/applications/mongodb.md b/content/en/docs/v1.0/applications/mongodb.md index 98d7f491..9d5cbbbc 100644 --- a/content/en/docs/v1.0/applications/mongodb.md +++ b/content/en/docs/v1.0/applications/mongodb.md @@ -10,7 +10,7 @@ aliases: diff --git a/content/en/docs/v1.0/applications/nats.md b/content/en/docs/v1.0/applications/nats.md index fe6f4c28..f18b63a3 100644 --- a/content/en/docs/v1.0/applications/nats.md +++ b/content/en/docs/v1.0/applications/nats.md @@ -10,7 +10,7 @@ aliases: diff --git a/content/en/docs/v1.0/applications/openbao.md b/content/en/docs/v1.0/applications/openbao.md index faf0ad64..332199dc 100644 --- a/content/en/docs/v1.0/applications/openbao.md +++ b/content/en/docs/v1.0/applications/openbao.md @@ -7,7 +7,7 @@ weight: 50 diff --git a/content/en/docs/v1.0/applications/postgres.md b/content/en/docs/v1.0/applications/postgres.md index e36b7557..a87e9260 100644 --- a/content/en/docs/v1.0/applications/postgres.md +++ b/content/en/docs/v1.0/applications/postgres.md @@ -10,7 +10,7 @@ aliases: diff --git a/content/en/docs/v1.0/applications/qdrant.md b/content/en/docs/v1.0/applications/qdrant.md index 027b045e..b6a9d533 100644 --- a/content/en/docs/v1.0/applications/qdrant.md +++ b/content/en/docs/v1.0/applications/qdrant.md @@ -7,7 +7,7 @@ weight: 50 diff --git a/content/en/docs/v1.0/applications/rabbitmq.md b/content/en/docs/v1.0/applications/rabbitmq.md index 84936d9d..bdf805b7 100644 --- a/content/en/docs/v1.0/applications/rabbitmq.md +++ b/content/en/docs/v1.0/applications/rabbitmq.md @@ -10,7 +10,7 @@ aliases: diff --git a/content/en/docs/v1.0/applications/redis.md b/content/en/docs/v1.0/applications/redis.md index 47c03890..d81eedd6 100644 --- a/content/en/docs/v1.0/applications/redis.md +++ b/content/en/docs/v1.0/applications/redis.md @@ -10,7 +10,7 @@ aliases: diff --git a/content/en/docs/v1.0/applications/tenant.md b/content/en/docs/v1.0/applications/tenant.md index 2d4a208e..1270d31f 100644 --- a/content/en/docs/v1.0/applications/tenant.md +++ b/content/en/docs/v1.0/applications/tenant.md @@ -10,7 +10,7 @@ aliases: diff --git a/content/en/docs/v1.0/kubernetes/_index.md b/content/en/docs/v1.0/kubernetes/_index.md index 7e7ad748..84b766bc 100644 --- a/content/en/docs/v1.0/kubernetes/_index.md +++ b/content/en/docs/v1.0/kubernetes/_index.md @@ -10,7 +10,7 @@ aliases: diff --git a/content/en/docs/v1.0/networking/http-cache.md b/content/en/docs/v1.0/networking/http-cache.md index 8d78e9c6..377b1035 100644 --- a/content/en/docs/v1.0/networking/http-cache.md +++ b/content/en/docs/v1.0/networking/http-cache.md @@ -11,7 +11,7 @@ aliases: diff --git a/content/en/docs/v1.0/networking/tcp-balancer.md b/content/en/docs/v1.0/networking/tcp-balancer.md index 1efed51a..616d32e0 100644 --- a/content/en/docs/v1.0/networking/tcp-balancer.md +++ b/content/en/docs/v1.0/networking/tcp-balancer.md @@ -11,7 +11,7 @@ aliases: diff --git a/content/en/docs/v1.0/networking/vpc.md b/content/en/docs/v1.0/networking/vpc.md index b127bf53..72b48384 100644 --- a/content/en/docs/v1.0/networking/vpc.md +++ b/content/en/docs/v1.0/networking/vpc.md @@ -11,7 +11,7 @@ aliases: diff --git a/content/en/docs/v1.0/networking/vpn.md b/content/en/docs/v1.0/networking/vpn.md index d47af63c..dc3f70ca 100644 --- a/content/en/docs/v1.0/networking/vpn.md +++ b/content/en/docs/v1.0/networking/vpn.md @@ -11,7 +11,7 @@ aliases: diff --git a/content/en/docs/v1.0/operations/services/bootbox.md b/content/en/docs/v1.0/operations/services/bootbox.md index 5b23b9b9..17ee1247 100644 --- a/content/en/docs/v1.0/operations/services/bootbox.md +++ b/content/en/docs/v1.0/operations/services/bootbox.md @@ -6,7 +6,7 @@ linkTitle: "BootBox" diff --git a/content/en/docs/v1.0/operations/services/etcd.md b/content/en/docs/v1.0/operations/services/etcd.md index 7c857b09..f96cc3fd 100644 --- a/content/en/docs/v1.0/operations/services/etcd.md +++ b/content/en/docs/v1.0/operations/services/etcd.md @@ -6,7 +6,7 @@ linkTitle: "Etcd" diff --git a/content/en/docs/v1.0/operations/services/ingress.md b/content/en/docs/v1.0/operations/services/ingress.md index 74a4f70c..fff6590e 100644 --- a/content/en/docs/v1.0/operations/services/ingress.md +++ b/content/en/docs/v1.0/operations/services/ingress.md @@ -6,7 +6,7 @@ linkTitle: "Ingress" diff --git a/content/en/docs/v1.0/operations/services/monitoring/parameters.md b/content/en/docs/v1.0/operations/services/monitoring/parameters.md index bce85911..f2cbdc56 100644 --- a/content/en/docs/v1.0/operations/services/monitoring/parameters.md +++ b/content/en/docs/v1.0/operations/services/monitoring/parameters.md @@ -7,7 +7,7 @@ weight: 1 diff --git a/content/en/docs/v1.0/operations/services/seaweedfs.md b/content/en/docs/v1.0/operations/services/seaweedfs.md index 277c72bf..84d3e7c2 100644 --- a/content/en/docs/v1.0/operations/services/seaweedfs.md +++ b/content/en/docs/v1.0/operations/services/seaweedfs.md @@ -6,7 +6,7 @@ linkTitle: "SeaweedFS" diff --git a/content/en/docs/v1.0/virtualization/vm-disk.md b/content/en/docs/v1.0/virtualization/vm-disk.md index 72618326..c6a6e8ef 100644 --- a/content/en/docs/v1.0/virtualization/vm-disk.md +++ b/content/en/docs/v1.0/virtualization/vm-disk.md @@ -10,7 +10,7 @@ aliases: diff --git a/content/en/docs/v1.0/virtualization/vm-instance.md b/content/en/docs/v1.0/virtualization/vm-instance.md index f75eb095..af3042df 100644 --- a/content/en/docs/v1.0/virtualization/vm-instance.md +++ b/content/en/docs/v1.0/virtualization/vm-instance.md @@ -10,7 +10,7 @@ aliases: diff --git a/hack/update_apps.sh b/hack/update_apps.sh index c4134292..3f00cf3d 100755 --- a/hack/update_apps.sh +++ b/hack/update_apps.sh @@ -6,12 +6,15 @@ usage() { Usage: hack/update_apps.sh [OPTIONS] Options: - --branch BRANCH Git branch in cozystack/cozystack (default: main) - --apps LIST Space- or comma-separated list of apps to update - --dest PATH Destination directory to write the *.md files to - --pkgdir DIR Subdirectory under packages/ to fetch from (default: apps). Examples: apps, extra - --index Write each app into path//_index.md instead of path/.md (creates subdirectory) - -h, --help Show this help and exit + --branch BRANCH Git ref in cozystack/cozystack used to FETCH README content (default: main) + --source-ref REF Git ref written into the displayed `source:` URL inside generated files. + Defaults to --branch if omitted. Use a stable ref (e.g., release-1.2) to + avoid flipping the source URL on every patch release. + --apps LIST Space- or comma-separated list of apps to update + --dest PATH Destination directory to write the *.md files to + --pkgdir DIR Subdirectory under packages/ to fetch from (default: apps). Examples: apps, extra + --index Write each app into path//_index.md instead of path/.md (creates subdirectory) + -h, --help Show this help and exit Notes: * Template markdown files are expected in DEST_DIR/_include (derived automatically). @@ -24,6 +27,7 @@ EOF } BRANCH="main" +SOURCE_REF="" DEST_DIR="" APPS=() INDEX_MODE="false" @@ -34,6 +38,8 @@ while [[ $# -gt 0 ]]; do case "$1" in --branch) BRANCH="$2"; shift 2 ;; + --source-ref) + SOURCE_REF="$2"; shift 2 ;; --apps) IFS=', ' read -r -a APPS <<< "$2"; shift 2 ;; --dest) @@ -69,6 +75,9 @@ fi # Derive templates location: DEST_DIR/_include SRC_DIR="${DEST_DIR%/}/_include" +# If --source-ref wasn't given, fall back to the fetch branch (preserves prior behavior) +SOURCE_REF="${SOURCE_REF:-$BRANCH}" + DOCS_REPO="cozystack/website" SOURCE_REPO="cozystack/cozystack" RAW_BASE_URL="https://raw.githubusercontent.com/${SOURCE_REPO}/${BRANCH}/packages/${PKG_DIR}" @@ -100,7 +109,7 @@ for app in "${APPS[@]}"; do EOF