1
1
#! /bin/bash
2
2
#
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.)
6
11
#
7
12
# Usage:
8
- # ./dev-utils/update-4x -branch.sh [TARGTAG [LASTTAG]]
13
+ # ./dev-utils/update-legacy-docs -branch.sh [TARGTAG [LASTTAG]]
9
14
10
15
if [ " $TRACE " != " " ]; then
11
16
export PS4=' ${BASH_SOURCE}:${LINENO}: ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'
@@ -20,7 +25,7 @@ function fatal {
20
25
}
21
26
22
27
TOP=$( cd $( dirname $0 ) /../ > /dev/null; pwd)
23
- WRKDIR=${TOP} /build/update-4x -branch
28
+ WRKDIR=${TOP} /build/update-legacy-docs -branch
24
29
25
30
echo " # Creating working git clone in: ${WRKDIR} /apm-agent-nodejs"
26
31
rm -rf $WRKDIR
@@ -40,8 +45,8 @@ if [[ ! ("$TARGTAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]$) ]]; then
40
45
fi
41
46
# echo "TARGTAG=$TARGTAG"
42
47
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.
45
50
LASTTAG=" $2 "
46
51
if [[ -z " $LASTTAG " ]]; then
47
52
readonly NUM_COMMITS_SANITY_GUARD=200
69
74
# `tac` works on Linux, `tail -r` works on BSD/macOS.
70
75
# https://stackoverflow.com/a/744093/14444044
71
76
echo
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
75
80
git checkout -b " $FEATBRANCH "
76
81
git log --pretty=format:" %h" $LASTTAG ...$TARGTAG \
77
82
| 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]
84
89
echo
85
90
echo " # You can create a PR now with:"
86
91
echo " 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)'"
88
93
0 commit comments