Skip to content

Commit

Permalink
independent 3.22.07.doc branch、adjust travis.yml deploy.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
wenyh1 committed Sep 27, 2023
1 parent be73213 commit 83684f4
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 31 deletions.
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ branches:
only:
- master
- develop
- /^[0-9]{1}.[0-9]{2}.[0-9]{2}.doc$/ #eg: 2.20.04.doc
# 调整时区
before_install:
- export TZ='Asia/Shanghai'
Expand All @@ -55,3 +56,10 @@ deploy:
script: bash ./deploy.sh master 1 ${GH_TOKEN} $TRAVIS_BUILD_NUMBER
on:
branch: master
#branch eg: 2.20.04.doc
- provider: script
skip_cleanup: true
script: bash ./deploy.sh $TRAVIS_BRANCH 1 ${GH_TOKEN} $TRAVIS_BUILD_NUMBER
on:
all_branches: true
condition: $TRAVIS_BRANCH =~ ^[0-9]{1}.[0-9]{2}.[0-9]{2}.doc$
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# dble 中文技术参考手册

## 注意
本分支上的手册适用于3.22.07.0版dble,其他版本的文档请参考对应tag分支或者release版文档。
本分支上的手册适用于3.22.07.x版dble,其他版本的文档请参考对应tag分支或者release版文档。

## 目录
参考 [gitbook](https://actiontech.github.io/dble-docs-cn) 左侧目录区 或 [SUMMARY.md](https://github.com/actiontech/dble-docs-cn/blob/master/SUMMARY.md)
Expand Down
50 changes: 25 additions & 25 deletions book.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,59 +11,59 @@
"options": [
{
"value": "https://actiontech.github.io/dble-docs-cn/",
"text": "Version 3.22.07.0"
"text": "Version 3.22.07"
},
{
"value": "https://actiontech.github.io/dble-docs-cn/history/develop/",
"text": "Version develop"
},
{
"value": "https://actiontech.github.io/dble-docs-cn/history/3.22.01.0/",
"text": "Version 3.22.01.0"
"value": "https://actiontech.github.io/dble-docs-cn/history/3.22.01.doc/",
"text": "Version 3.22.01"
},
{
"value": "https://actiontech.github.io/dble-docs-cn/history/3.21.10.0/",
"text": "Version 3.21.10.0"
"value": "https://actiontech.github.io/dble-docs-cn/history/3.21.10.doc/",
"text": "Version 3.21.10"
},
{
"value": "https://actiontech.github.io/dble-docs-cn/history/3.21.06.0/",
"text": "Version 3.21.06.0"
"value": "https://actiontech.github.io/dble-docs-cn/history/3.21.06.doc/",
"text": "Version 3.21.06"
},
{
"value": "https://actiontech.github.io/dble-docs-cn/history/3.21.02.0/",
"text": "Version 3.21.02.0"
"value": "https://actiontech.github.io/dble-docs-cn/history/3.21.02.doc/",
"text": "Version 3.21.02"
},
{
"value": "https://actiontech.github.io/dble-docs-cn/history/3.20.10.0/",
"text": "Version 3.20.10.0"
"value": "https://actiontech.github.io/dble-docs-cn/history/3.20.10.doc/",
"text": "Version 3.20.10"
},
{
"value": "https://actiontech.github.io/dble-docs-cn/history/3.20.07.0/",
"text": "Version 3.20.07.0"
"value": "https://actiontech.github.io/dble-docs-cn/history/3.20.07.doc/",
"text": "Version 3.20.07"
},
{
"value": "https://actiontech.github.io/dble-docs-cn/history/2.20.04.0/",
"text": "Version 2.20.04.0"
"value": "https://actiontech.github.io/dble-docs-cn/history/2.20.04.doc/",
"text": "Version 2.20.04"
},
{
"value": "https://actiontech.github.io/dble-docs-cn/history/2.19.11.0/",
"text": "Version 2.19.11.0"
"value": "https://actiontech.github.io/dble-docs-cn/history/2.19.11.doc/",
"text": "Version 2.19.11"
},
{
"value": "https://actiontech.github.io/dble-docs-cn/history/2.19.09.0/",
"text": "Version 2.19.09.0"
"value": "https://actiontech.github.io/dble-docs-cn/history/2.19.09.doc/",
"text": "Version 2.19.09"
},
{
"value": "https://actiontech.github.io/dble-docs-cn/history/2.19.07.0/",
"text": "Version 2.19.07.0"
"value": "https://actiontech.github.io/dble-docs-cn/history/2.19.07.doc/",
"text": "Version 2.19.07"
},
{
"value": "https://actiontech.github.io/dble-docs-cn/history/2.19.05.0/",
"text": "Version 2.19.05.0"
"value": "https://actiontech.github.io/dble-docs-cn/history/2.19.05.doc/",
"text": "Version 2.19.05"
},
{
"value": "https://actiontech.github.io/dble-docs-cn/history/2.19.03.0/",
"text": "Version 2.19.03.0"
"value": "https://actiontech.github.io/dble-docs-cn/history/2.19.03.doc/",
"text": "Version 2.19.03"
}
]
},
Expand Down
46 changes: 41 additions & 5 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ GH_REF="github.com/actiontech/dble-docs-cn"
GH_USER="actiontech-bot"
GH_MAIL="github@actionsky.com"

reg='^[0-9]{1}\.[0-9]{2}\.[0-9]{2}\.doc$' #eg: 2.20.04.doc
if [ "$VERSION" = "master" ]; then
# pdf
# xvfb-run gitbook pdf ./ ./dble-manual.pdf
Expand Down Expand Up @@ -38,9 +39,9 @@ if [ "$VERSION" = "master" ]; then
git config user.email "${GH_MAIL}"
git add .
git commit -m "Update GitBook By TravisCI With Build $TRAVIS_BUILD_NUMBER"
git push --force --quiet "https://${GH_TOKEN}@${GH_REF}" master:gh-pages
git push --force --quiet "https://${GH_TOKEN}@${GH_REF}.git" master:gh-pages
fi

elif [ "$VERSION" = "develop" ]; then
# merge master—pages
mkdir _master_book
Expand All @@ -56,16 +57,51 @@ elif [ "$VERSION" = "develop" ]; then
cd ./_master_book/dble-docs-cn
git add .
git commit -m "Update GitBook By TravisCI With Build $TRAVIS_BUILD_NUMBER"
git push --force --quiet "https://${GH_TOKEN}@${GH_REF}" gh-pages:gh-pages
git push --force --quiet "https://${GH_TOKEN}@${GH_REF}.git" gh-pages:gh-pages
# push develop—pages
cd ../../_book
git init
git config user.name "${GH_USER}"
git config user.email "${GH_MAIL}"
git add .
git commit -m "Update GitBook By TravisCI With Build $TRAVIS_BUILD_NUMBER"
git push --force --quiet "https://${GH_TOKEN}@${GH_REF}" master:develop-pages
git push --force --quiet "https://${GH_TOKEN}@${GH_REF}.git" master:develop-pages
fi
elif [[ "$VERSION" =~ $reg ]]; then
mkdir _old_book
cd ./_old_book
COMMAND_LINE="git clone -b history-pages https://${GH_REF}.git"
eval "$COMMAND_LINE"
rm -rf dble-docs-cn/$VERSION
cd ..
cp -R _book/ _old_book/dble-docs-cn/$VERSION
cd _old_book/dble-docs-cn/$VERSION
rm -rf .gitignore .travis.yml deploy.sh package-lock.json

cd ../../..
mkdir _master_book
cd ./_master_book
COMMAND_LINE="git clone -b gh-pages https://${GH_REF}.git"
eval "$COMMAND_LINE"
rm -rf dble-docs-cn/history/$VERSION/
cd ..
cp -R _book/ _master_book/dble-docs-cn/history/$VERSION/
cd _master_book/dble-docs-cn/history/$VERSION/
rm -rf .gitignore .travis.yml deploy.sh package-lock.json
cd ../../../..

## push
if [ "$DEPLOY" = "1" ]; then
cd ./_old_book/dble-docs-cn ##history-pages
git add .
git commit -m "Update GitBook By TravisCI With Build $TRAVIS_BUILD_NUMBER"
git push --force --quiet "https://${GH_TOKEN}@${GH_REF}.git" history-pages:history-pages
cd ../../
cd ./_master_book/dble-docs-cn ##gh-pages
git add .
git commit -m "Update GitBook By TravisCI With Build $TRAVIS_BUILD_NUMBER"
git push --force --quiet "https://${GH_TOKEN}@${GH_REF}.git" gh-pages:gh-pages
fi
else
else
echo "do nothing"
fi

0 comments on commit 83684f4

Please sign in to comment.