11#! /bin/bash
22#
3- # Create a PR to update the 4.x branch to match the state of "main" for the
4- # just-tagged release. The 4.x branch needs to be updated for the current docs
5- # build.
3+ # Create a PR to update the `do-not-delete_legacy-docs` branch to match the
4+ # state of "main" for the just-tagged release. The `do-not-delete_legacy-docs`
5+ # branch needs to be updated for the current docs build.
6+ #
7+ # (Here "legacy docs" means the old Elastic (v1?) docs system based on
8+ # AsciiDoc sources and the elastic/docs.git tooling. Around Mar/Apr 2025
9+ # this docs system is being phased out in favour of a "docs v3" system based
10+ # on Markdown sources and new tooling.)
611#
712# Usage:
8- # ./dev-utils/update-4x -branch.sh [TARGTAG [LASTTAG]]
13+ # ./dev-utils/update-legacy-docs -branch.sh [TARGTAG [LASTTAG]]
914
1015if [ " $TRACE " != " " ]; then
1116 export PS4=' ${BASH_SOURCE}:${LINENO}: ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'
@@ -20,7 +25,7 @@ function fatal {
2025}
2126
2227TOP=$( cd $( dirname $0 ) /../ > /dev/null; pwd)
23- WRKDIR=${TOP} /build/update-4x -branch
28+ WRKDIR=${TOP} /build/update-legacy-docs -branch
2429
2530echo " # Creating working git clone in: ${WRKDIR} /apm-agent-nodejs"
2631rm -rf $WRKDIR
@@ -40,8 +45,8 @@ if [[ ! ("$TARGTAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]$) ]]; then
4045fi
4146# echo "TARGTAG=$TARGTAG"
4247
43- # Allow passing in last tag (second arg), in case the 4.x branch wasn't updated
44- # for some previous releases.
48+ # Allow passing in last tag (second arg), in case the
49+ # 'do-not-delete_legacy-docs' branch wasn't updated for some previous releases.
4550LASTTAG=" $2 "
4651if [[ -z " $LASTTAG " ]]; then
4752 readonly NUM_COMMITS_SANITY_GUARD=200
6974# `tac` works on Linux, `tail -r` works on BSD/macOS.
7075# https://stackoverflow.com/a/744093/14444044
7176echo
72- echo " # Creating PR to update 4.x branch with commits from $LASTTAG to $TARGTAG ."
73- FEATBRANCH=update-4x -branch-$( date +%Y%m%d)
74- git checkout 4.x
77+ echo " # Creating PR to update 'do-not-delete_legacy-docs' branch with commits from $LASTTAG to $TARGTAG ."
78+ FEATBRANCH=update-legacy-docs -branch-$( date +%Y%m%d)
79+ git checkout do-not-delete_legacy-docs
7580git checkout -b " $FEATBRANCH "
7681git log --pretty=format:" %h" $LASTTAG ...$TARGTAG \
7782 | awk ' {a[i++]=$0} END {for (j=i-1; j>=0;) print a[j--] }' \
@@ -84,5 +89,5 @@ RELEASE_PR=$(git log --pretty=format:"%s" -1 $TARGTAG | sed -E 's/^.* \(\#([0-9]
8489echo
8590echo " # You can create a PR now with:"
8691echo " cd $WRKDIR /apm-agent-nodejs"
87- echo " gh pr create -w -B 4.x -t 'docs: update 4.x branch for $TARGTAG release' --body 'Refs: #$RELEASE_PR (release PR)'"
92+ echo " gh pr create -w -B " do-not-delete_legacy-docs " -t 'docs: update " do-not-delete_legacy-docs " branch for $TARGTAG release' --body 'Refs: #$RELEASE_PR (release PR)'"
8893
0 commit comments