-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathextract_docs.sh
executable file
·74 lines (58 loc) · 1.84 KB
/
extract_docs.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/bash
set -exu -o pipefail
# brew install git-filter-repo
# download *new* copy of operator
rm -rf ./couchbase-operator
gh repo clone couchbase/couchbase-operator
rm -rf ./docs-operator
mv couchbase-operator docs-operator
cd docs-operator
REFS="master 2.8.x 2.7.x 2.6.x 2.5.x 2.4.x"
IFS=' '
for REF in $REFS; do
git checkout $REF;
done
unset IFS
git filter-repo \
--subdirectory-filter docs/user/ \
--path docs/dev/drawio-charts \
--path-rename docs/dev/drawio-charts/:drawio-charts/ \
--refs $REFS \
--force
git filter-repo \
--invert-paths \
--path modules/ROOT/pages/resource \
--path modules/ROOT/pages/tools \
--path modules/ROOT/attachments \
--refs $REFS
git remote rm origin
git remote add origin https://github.com/couchbase/docs-operator.git
cp ../extract_docs.sh .
# Github doesn't process include:: https://github.com/github/markup/issues/1095
# so workaround by splitting README into head and tail portions
cat ../README.adoc.head extract_docs.sh ../README.adoc.tail > README.adoc
git add README.adoc extract_docs.sh
git commit -m "DOC-13085: extract docs from couchbase-operator monorepo"
git branch -m release/2.4
git push -u origin release/2.4 --force
git tag docs-repo-extraction release/2.4
git checkout 2.5.x
git branch -m release/2.5
git cherry-pick docs-repo-extraction
git push -u origin release/2.5 --force
git checkout 2.6.x
git branch -m release/2.6
git cherry-pick docs-repo-extraction
git push -u origin release/2.6 --force
git checkout 2.7.x
git branch -m release/2.7
git cherry-pick docs-repo-extraction
git push -u origin release/2.7 --force
git checkout 2.8.x
git branch -m release/2.8
git cherry-pick docs-repo-extraction
git push -u origin release/2.8 --force
git checkout master
git branch -m release/2.8.1
git cherry-pick docs-repo-extraction
git push -u origin release/2.8.1 --force