Skip to content

Commit

Permalink
fix old dir of showdoc_data
Browse files Browse the repository at this point in the history
  • Loading branch information
xiagw committed Jul 17, 2023
1 parent 63aaeba commit 21058b0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ services:
ports:
- 4999:80
volumes:
## 兼容历史版本文件
- /showdoc_data:/showdoc_data_old
- ./showdocdata/html:/var/www/html
restart: always
tty: true
Expand Down
11 changes: 10 additions & 1 deletion docker.run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ set -e

## web site dir
showdoc_dir='/showdoc_data'
showdoc_dir_old='/showdoc_data_old'
showdoc_dir_old_skip='/showdoc_data_old/.skip_old'
showdoc_html_dir="$showdoc_dir/html"
web_dir='/var/www/html'
file_ver=$web_dir/.ver
Expand All @@ -14,7 +16,14 @@ if [ -f "$web_dir/index.php" ]; then
echo "Found $web_dir/index.php, skip copy."
else
echo "Not found $web_dir/index.php, copy..."
rsync -a $showdoc_html_dir/ $web_dir/
## 兼容历史版本
if [[ -f $showdoc_dir_old/html/index.php && ! -f $showdoc_dir_old_skip ]]; then
echo "Found old version of \"showdoc_data\", copy..."
rsync -a $showdoc_dir_old/html/ $web_dir/ &&
touch $showdoc_dir_old_skip
else
rsync -a $showdoc_html_dir/ $web_dir/
fi
fi
## upgrade (通过 Dockerfile 的环境变量 变更版本)
if [ -f $file_ver ]; then
Expand Down

0 comments on commit 21058b0

Please sign in to comment.