Skip to content

Commit f469efe

Browse files
committed
independent 3.22.11.doc branch、adjust travis.yml deploy.sh
1 parent a7f6a76 commit f469efe

File tree

4 files changed

+74
-30
lines changed

4 files changed

+74
-30
lines changed

.travis.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ branches:
2929
only:
3030
- master
3131
- develop
32+
- /^[0-9]{1}.[0-9]{2}.[0-9]{2}.doc$/ #eg: 2.20.04.doc
3233
# 调整时区
3334
before_install:
3435
- export TZ='Asia/Shanghai'
@@ -55,3 +56,10 @@ deploy:
5556
script: bash ./deploy.sh master 1 ${GH_TOKEN} $TRAVIS_BUILD_NUMBER
5657
on:
5758
branch: master
59+
#branch eg: 2.20.04.doc
60+
- provider: script
61+
skip_cleanup: true
62+
script: bash ./deploy.sh $TRAVIS_BRANCH 1 ${GH_TOKEN} $TRAVIS_BUILD_NUMBER
63+
on:
64+
all_branches: true
65+
condition: $TRAVIS_BRANCH =~ ^[0-9]{1}.[0-9]{2}.[0-9]{2}.doc$

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# dble 中文技术参考手册
22

33
## 注意
4-
本分支上的手册适用于3.22.11.0版dble,其他版本的文档请参考对应tag分支或者release版文档。
4+
本分支上的手册适用于3.22.11.x版dble,其他版本的文档请参考对应tag分支或者release版文档。
55

66
## 目录
77
参考 [gitbook](https://actiontech.github.io/dble-docs-cn) 左侧目录区 或 [SUMMARY.md](https://github.com/actiontech/dble-docs-cn/blob/master/SUMMARY.md)

book.json

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11,63 +11,63 @@
1111
"options": [
1212
{
1313
"value": "https://actiontech.github.io/dble-docs-cn/",
14-
"text": "Version 3.22.11.0"
14+
"text": "Version 3.22.11"
1515
},
1616
{
1717
"value": "https://actiontech.github.io/dble-docs-cn/history/develop/",
1818
"text": "Version develop"
1919
},
2020
{
21-
"value": "https://actiontech.github.io/dble-docs-cn/history/3.22.07.0/",
22-
"text": "Version 3.22.07.0"
21+
"value": "https://actiontech.github.io/dble-docs-cn/history/3.22.07.doc/",
22+
"text": "Version 3.22.07"
2323
},
2424
{
25-
"value": "https://actiontech.github.io/dble-docs-cn/history/3.22.01.0/",
26-
"text": "Version 3.22.01.0"
25+
"value": "https://actiontech.github.io/dble-docs-cn/history/3.22.01.doc/",
26+
"text": "Version 3.22.01"
2727
},
2828
{
29-
"value": "https://actiontech.github.io/dble-docs-cn/history/3.21.10.0/",
30-
"text": "Version 3.21.10.0"
29+
"value": "https://actiontech.github.io/dble-docs-cn/history/3.21.10.doc/",
30+
"text": "Version 3.21.10"
3131
},
3232
{
33-
"value": "https://actiontech.github.io/dble-docs-cn/history/3.21.06.0/",
34-
"text": "Version 3.21.06.0"
33+
"value": "https://actiontech.github.io/dble-docs-cn/history/3.21.06.doc/",
34+
"text": "Version 3.21.06"
3535
},
3636
{
37-
"value": "https://actiontech.github.io/dble-docs-cn/history/3.21.02.0/",
38-
"text": "Version 3.21.02.0"
37+
"value": "https://actiontech.github.io/dble-docs-cn/history/3.21.02.doc/",
38+
"text": "Version 3.21.02"
3939
},
4040
{
41-
"value": "https://actiontech.github.io/dble-docs-cn/history/3.20.10.0/",
42-
"text": "Version 3.20.10.0"
41+
"value": "https://actiontech.github.io/dble-docs-cn/history/3.20.10.doc/",
42+
"text": "Version 3.20.10"
4343
},
4444
{
45-
"value": "https://actiontech.github.io/dble-docs-cn/history/3.20.07.0/",
46-
"text": "Version 3.20.07.0"
45+
"value": "https://actiontech.github.io/dble-docs-cn/history/3.20.07.doc/",
46+
"text": "Version 3.20.07"
4747
},
4848
{
49-
"value": "https://actiontech.github.io/dble-docs-cn/history/2.20.04.0/",
50-
"text": "Version 2.20.04.0"
49+
"value": "https://actiontech.github.io/dble-docs-cn/history/2.20.04.doc/",
50+
"text": "Version 2.20.04"
5151
},
5252
{
53-
"value": "https://actiontech.github.io/dble-docs-cn/history/2.19.11.0/",
54-
"text": "Version 2.19.11.0"
53+
"value": "https://actiontech.github.io/dble-docs-cn/history/2.19.11.doc/",
54+
"text": "Version 2.19.11"
5555
},
5656
{
57-
"value": "https://actiontech.github.io/dble-docs-cn/history/2.19.09.0/",
58-
"text": "Version 2.19.09.0"
57+
"value": "https://actiontech.github.io/dble-docs-cn/history/2.19.09.doc/",
58+
"text": "Version 2.19.09"
5959
},
6060
{
61-
"value": "https://actiontech.github.io/dble-docs-cn/history/2.19.07.0/",
62-
"text": "Version 2.19.07.0"
61+
"value": "https://actiontech.github.io/dble-docs-cn/history/2.19.07.doc/",
62+
"text": "Version 2.19.07"
6363
},
6464
{
65-
"value": "https://actiontech.github.io/dble-docs-cn/history/2.19.05.0/",
66-
"text": "Version 2.19.05.0"
65+
"value": "https://actiontech.github.io/dble-docs-cn/history/2.19.05.doc/",
66+
"text": "Version 2.19.05"
6767
},
6868
{
69-
"value": "https://actiontech.github.io/dble-docs-cn/history/2.19.03.0/",
70-
"text": "Version 2.19.03.0"
69+
"value": "https://actiontech.github.io/dble-docs-cn/history/2.19.03.doc/",
70+
"text": "Version 2.19.03"
7171
}
7272
]
7373
},

deploy.sh

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ GH_REF="github.com/actiontech/dble-docs-cn"
1111
GH_USER="actiontech-bot"
1212
GH_MAIL="github@actionsky.com"
1313

14+
reg='^[0-9]{1}\.[0-9]{2}\.[0-9]{2}\.doc$' #eg: 2.20.04.doc
1415
if [ "$VERSION" = "master" ]; then
1516
# pdf
1617
# xvfb-run gitbook pdf ./ ./dble-manual.pdf
@@ -40,7 +41,7 @@ if [ "$VERSION" = "master" ]; then
4041
git commit -m "Update GitBook By TravisCI With Build $TRAVIS_BUILD_NUMBER"
4142
git push --force --quiet "https://${GH_TOKEN}@${GH_REF}.git" master:gh-pages
4243
fi
43-
44+
4445
elif [ "$VERSION" = "develop" ]; then
4546
# merge master—pages
4647
mkdir _master_book
@@ -66,6 +67,41 @@ elif [ "$VERSION" = "develop" ]; then
6667
git commit -m "Update GitBook By TravisCI With Build $TRAVIS_BUILD_NUMBER"
6768
git push --force --quiet "https://${GH_TOKEN}@${GH_REF}.git" master:develop-pages
6869
fi
69-
else
70+
elif [[ "$VERSION" =~ $reg ]]; then
71+
mkdir _old_book
72+
cd ./_old_book
73+
COMMAND_LINE="git clone -b history-pages https://${GH_REF}.git"
74+
eval "$COMMAND_LINE"
75+
rm -rf dble-docs-cn/$VERSION
76+
cd ..
77+
cp -R _book/ _old_book/dble-docs-cn/$VERSION
78+
cd _old_book/dble-docs-cn/$VERSION
79+
rm -rf .gitignore .travis.yml deploy.sh package-lock.json
80+
81+
cd ../../..
82+
mkdir _master_book
83+
cd ./_master_book
84+
COMMAND_LINE="git clone -b gh-pages https://${GH_REF}.git"
85+
eval "$COMMAND_LINE"
86+
rm -rf dble-docs-cn/history/$VERSION/
87+
cd ..
88+
cp -R _book/ _master_book/dble-docs-cn/history/$VERSION/
89+
cd _master_book/dble-docs-cn/history/$VERSION/
90+
rm -rf .gitignore .travis.yml deploy.sh package-lock.json
91+
cd ../../../..
92+
93+
## push
94+
if [ "$DEPLOY" = "1" ]; then
95+
cd ./_old_book/dble-docs-cn ##history-pages
96+
git add .
97+
git commit -m "Update GitBook By TravisCI With Build $TRAVIS_BUILD_NUMBER"
98+
git push --force --quiet "https://${GH_TOKEN}@${GH_REF}.git" history-pages:history-pages
99+
cd ../../
100+
cd ./_master_book/dble-docs-cn ##gh-pages
101+
git add .
102+
git commit -m "Update GitBook By TravisCI With Build $TRAVIS_BUILD_NUMBER"
103+
git push --force --quiet "https://${GH_TOKEN}@${GH_REF}.git" gh-pages:gh-pages
104+
fi
105+
else
70106
echo "do nothing"
71107
fi

0 commit comments

Comments
 (0)