website/scripts
Qiming Teng d80a20ea6a Improve the lsync script
This PR improves the lsync script so that it can handle directories
(recursively). For example, you can run the following command to find
the detailed changes that are out of sync:

```
./scripts/lsync content/zh/docs/concepts/_index.md
```

and you can run the following command to identify how many files are
out of sync under a given directory:

```
> ./scripts/lsync content/zh/docs/concepts/

content/en/docs/concepts/architecture/control-plane-node-communication.md        |  2 +-
 content/en/docs/concepts/architecture/controller.md                              | 10 ++++++++++
 content/en/docs/concepts/cluster-administration/logging.md                       |  4 ++--
 content/en/docs/concepts/cluster-administration/system-metrics.md                |  2 +-
 content/en/docs/concepts/configuration/pod-priority-preemption.md                |  2 +-
 content/en/docs/concepts/containers/runtime-class.md                             |  2 +-
 content/en/docs/concepts/extend-kubernetes/compute-storage-net/device-plugins.md |  2 +-
 content/en/docs/concepts/extend-kubernetes/operator.md                           |  2 +-
 content/en/docs/concepts/extend-kubernetes/service-catalog.md                    |  2 +-
 content/en/docs/concepts/overview/kubernetes-api.md                              |  2 +-
 content/en/docs/concepts/overview/what-is-kubernetes.md                          |  3 +--
 content/en/docs/concepts/overview/working-with-objects/labels.md                 |  2 +-
 content/en/docs/concepts/scheduling-eviction/kube-scheduler.md                   |  4 ++--
 content/en/docs/concepts/services-networking/dual-stack.md                       |  2 +-
 content/en/docs/concepts/storage/ephemeral-volumes.md                            | 11 +++++------
 content/en/docs/concepts/storage/persistent-volumes.md                           |  2 +-
 content/en/docs/concepts/storage/storage-classes.md                              |  2 +-
 content/en/docs/concepts/storage/volumes.md                                      |  5 ++---
 content/en/docs/concepts/workloads/_index.md                                     |  2 +-
 content/en/docs/concepts/workloads/controllers/replicaset.md                     |  4 ++--
 content/en/docs/concepts/workloads/pods/_index.md                                |  4 ++--
 content/en/docs/concepts/workloads/pods/pod-lifecycle.md                         |  3 ++-

```
2020-10-24 09:31:49 +08:00
..
README.md cleanup: remove hugo-version-check.sh. (#18817) 2020-02-11 11:28:07 -08:00
check-headers-file.sh Add _headers file checking logic (#9879) 2018-08-21 12:51:15 -07:00
diff_l10n_branches.py Changed to print the directory name according to the l10n language. (#18473) 2020-01-08 14:05:41 -08:00
find_pr.py Added error handling to find_pr script (#14110) 2019-05-08 14:12:35 -07:00
hash-files.sh automatically derive image version 2020-07-22 11:04:09 -07:00
linkchecker.py Link checker for doc site. 2020-07-20 16:19:06 +08:00
lsync.sh Improve the lsync script 2020-10-24 09:31:49 +08:00
replace-capture.sh Autodetect content directory for capture cleanup tool 2020-06-29 18:26:56 +01:00
requirements.txt Add readme for scripts (#14913) 2019-07-08 15:24:00 -07:00
test_examples.sh Check all commits in branch for examples (to trigger testing) (#14243) 2019-06-10 19:54:16 -07:00
upstream_changes.py Add a script to check differences between translated and English version (#14731) 2019-06-12 06:49:33 -07:00

README.md

Development scripts for Kubernetes documentation

Script Description
find_pr.py Find what GitHub pull requests touch a given file.
upstream_changes.py Find what changes occurred between two versions.
test_examples.sh This script tests whether a change affects example files bundled in the website.
check-headers-file.sh This script checks the headers if you are in a production environment.
diff_l10n_branches.py This script generates a report of outdated contents in content/<l10n-lang> directory by comparing two l10n team milestone branches.

Requirements

Some of those scripts have external requirements. You can install them with the following commands:

python3 -m pip install -r requirements.txt

find_pr.py

$ ./find_pr.py --help
Usage: find_pr.py [OPTIONS] PATH

  Find what GitHub pull requests touch a given file.

  ex: ./find_pr.py --tags "language/fr" "content/fr/_index.html"

Options:
  --tags TEXT          Tags of PullRequest (Can be passed multiple times)
  --token TEXT         GitHub API token. (Default env variable GITHUB_TOKEN)
  --last-n-pr INTEGER  Last n-th PullRequests
  --help               Show this message and exit.

upstream_changes.py

$ ./upstream_changes.py --help
Usage: upstream_changes.py [OPTIONS] PATH

  Find what changes occurred between two versions

  ex: ./upstream_changes.py content/fr/_index.html

Options:
  --reference TEXT  Specify the reference version of the file. Default to the
                    English one.
  --git-path TEXT   Specify git path
  --help            Show this message and exit.

test_examples.sh

This script tests whether a change affects example files bundled in the website.

To install the dependencies:

$ ./scripts/test_examples.sh install

To run the examples:

$ ./scripts/test_examples.sh run

check-headers-file.sh

This script checks the headers if you are in a production environment.

./scripts/check-headers-file.sh

diff_l10n_branches.py

$ scripts/diff_l10n_branches.py --help
Usage: diff_l10n_branches.py [OPTIONS] L10N_LANG L_COMMIT R_COMMIT

  This script generates a report of outdated contents in `content/<l10n-
  lang>` directory by comparing two l10n team milestone branches.

  L10n team owners can open a GitHub issue with the report generated by this
  script when they start a new team milestone.

  ex: `scripts/diff_l10n_branches.py ko dev-1.15-ko.3 dev-1.15-ko.4`

Options:
  --src-lang TEXT  Source language
  --help           Show this message and exit.