Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.1/scripts: update verify links to fix current layout #1850

Merged
merged 4 commits into from
Feb 24, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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).
For more deployment methods, see [TiDB deployment methods](/_index.md).
cofyc marked this conversation as resolved.
Show resolved Hide resolved

## 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