Skip to content

Commit

Permalink
2.1/scripts: update verify links to fix current layout (#1848)
Browse files Browse the repository at this point in the history
* scripts: update scripts/verify-links.sh (#1846)

* re-enable links must start with slash

* deploy-tidb-from-docker-compose.md does not exist in release 2.1

* remove trailing spaces

* Update dev-guide/deploy.md

Co-Authored-By: Keke Yi <40977455+yikeke@users.noreply.github.com>

Co-authored-by: Keke Yi <40977455+yikeke@users.noreply.github.com>
  • Loading branch information
cofyc and yikeke committed Feb 24, 2020
1 parent 6582f0a commit e2b366f
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 39 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ TiDB expands both SQL processing and storage by simply adding new nodes. This ma

TiDB acts like it is a MySQL 5.7 server to your applications. You can continue to use all of the existing MySQL client libraries, and in many cases, you will not need to change a single line of code in your application.

TiDB does not have 100% MySQL compatibility because we built the layer from scratch in order to maximize the performance advantages inherent to a distributed system. We believe in being transparent about the level of MySQL compatibility that TiDB provides. Please check out the list of [known compatibility differences](./sql/mysql-compatibility.md).
TiDB does not have 100% MySQL compatibility because we built the layer from scratch in order to maximize the performance advantages inherent to a distributed system. We believe in being transparent about the level of MySQL compatibility that TiDB provides. Please check out the list of [known compatibility differences](/reference/mysql-compatibility.md).

### Replicate from and to MySQL

Expand Down
8 changes: 4 additions & 4 deletions dev-guide/deploy.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Build for deployment

The easiest way to deploy TiDB is to use Docker Compose, see [TiDB Docker Compose Deployment](../dev/how-to/get-started/deploy-tidb-from-docker-compose.md). For more deployment methods, see [TiDB deployment methods](../_index.md).
The easiest way to deploy TiDB is to use Docker Compose, see [TiDB Docker Compose Deployment](https://pingcap.com/docs-cn/dev/how-to/get-started/deploy-tidb-from-docker-compose/). For more deployment methods, see [TiDB deployment methods](/_index.md).

## Before you begin

You need to check the [supported platforms](./requirements.md#supported-platforms) and [prerequisites](./requirements.md#prerequisites) first.
You need to check the [supported platforms](/dev-guide/requirements.md#supported-platforms) and [prerequisites](/dev-guide/requirements.md#prerequisites) first.

## Build and install TiDB components

You can use the [build script](../scripts/build.sh) to build and install TiDB components in the `bin` directory.
You can use the [build script](/scripts/build.sh) to build and install TiDB components in the `bin` directory.

You can use the [update script](../scripts/update.sh) to update all the TiDB components to the latest version.
You can use the [update script](/scripts/update.sh) to update all the TiDB components to the latest version.
2 changes: 1 addition & 1 deletion dev-guide/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ If you want to develop the TiDB project, you can follow this guide.

## Before you begin

You need to check the [supported platforms](./requirements.md#supported-platforms) and [prerequisites](./requirements.md#prerequisites) first.
You need to check the [supported platforms](/dev-guide/requirements.md#supported-platforms) and [prerequisites](/dev-guide/requirements.md#prerequisites) first.

## Build TiKV

Expand Down
2 changes: 1 addition & 1 deletion dev-guide/requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ The following table lists TiDB support for common architectures and operating sy
+ GCC 4.8+ with static library
+ CMake 3.1+

The [check requirement script](../scripts/check_requirement.sh) can help you check prerequisites and install the missing ones automatically.
The [check requirement script](/scripts/check_requirement.sh) can help you check prerequisites and install the missing ones automatically.

TiKV is well tested in a certain Rust version by us, and the exact version can be found in the `RUST_VERSION` file in TiKV's root directory. It is recommended to use the same version as we do.
6 changes: 3 additions & 3 deletions scripts/markdown-link-check.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
}
],
"replacementPatterns": [
{
"pattern": "^(?!(/<VERSION>/|/media/))",
"replacement": "/ERROR:link-must-start-with-slash-and-cannot-reference-files-in-other-version-directory:"
{
"pattern": "^(?!(/|/media/))",
"replacement": "/ERROR:link-must-start-with-slash:"
},
{
"comment": "prefix with repo root",
Expand Down
51 changes: 22 additions & 29 deletions scripts/verify-links.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,35 +39,28 @@ function in_array() {
}

# Check all directories starting with 'v\d.*' and dev.
for d in dev $(ls -d v[0-9]*); do
if in_array $d "${IGNORE_DIRS[@]}"; then
echo "info: directory $d skipped"
continue
fi
echo "info: checking links under $d directory..."
sed \
-e "s#<ROOT>#$ROOT#g" \
-e "s#<VERSION>#$d#g" \
scripts/markdown-link-check.tpl > $CONFIG_TMP
if [ -n "$VERBOSE" ]; then
cat $CONFIG_TMP
fi
# TODO simplify this if markdown-link-check can process multiple files together
while read -r tasks; do
for task in $tasks; do
(
output=$(markdown-link-check --color --config "$CONFIG_TMP" "$task" -q)
if [ $? -ne 0 ]; then
printf "$output" >> $ERROR_REPORT
fi
if [ -n "$VERBOSE" ]; then
echo "$output"
fi
) &
done
wait
done <<<"$(find "$d" -type f -name '*.md' | xargs -n 10)"
done
echo "info: checking links under $ROOT directory..."
sed \
-e "s#<ROOT>#$ROOT#g" \
scripts/markdown-link-check.tpl > $CONFIG_TMP
if [ -n "$VERBOSE" ]; then
cat $CONFIG_TMP
fi
# TODO simplify this if markdown-link-check can process multiple files together
while read -r tasks; do
for task in $tasks; do
(
output=$(markdown-link-check --color --config "$CONFIG_TMP" "$task" -q)
if [ $? -ne 0 ]; then
printf "$output" >> $ERROR_REPORT
fi
if [ -n "$VERBOSE" ]; then
echo "$output"
fi
) &
done
wait
done <<<"$(find "." -type f -not -path './node_modules/*' -name '*.md' | xargs -n 10)"

error_files=$(cat $ERROR_REPORT | grep 'FILE: ' | wc -l)
error_output=$(cat $ERROR_REPORT)
Expand Down

0 comments on commit e2b366f

Please sign in to comment.