ansys-tools-repo-sync#

PyAnsys Python PyPI GH-CI Codecov MIT Black pre-commit.ci status

The ansys-tools-repo-sync library is intended to synchronize the content of two different repositories.

What does this library do?#

For instance, due to intellectual properties concerns, it might not be possible to expose publicly the entire content of a private repository. Its owner could decide to have a second repository, a public one. Part of the content for this public repo would come from the private repository.

ansys-tools-repo-sync allows you to do so by copying a folder and its content from one repo to the other.

By default, nothing is synced to the secondary repository (in order to avoid undesired content). For that purpose, users have to provide a manifest file (in ASCII format) that contains regular expressions for the files accepted.

For example, if we wanted to sync all *.py files, one should generate a manifest file as follows:

*.py
_images/repo_sync.png

How to use it?#

A common usage for this tool consist to integrate it in one of your CI/CD pipeline or workflow. Firstly, the tool must be installed.

pip install ansys-tools-repo-sync

Then, it can be used in the considered workflow with the appropriate arguments.

Run it as follows:

repo-sync \
  --token <token> \
  --owner <organization-name> \
  --repository <repository-name> \
  --from-dir <path-to-dir-containing-files-to-sync> \
  --to-dir <target-dir-for-sync> \
  --include-manifest <path-to-manifest>

The options above are compulsory in order to run the tool. If an option is missing, the operation will fail. For more information on all the available options for this tool, users can run:

repo-sync --help

Note

The --dry-run flag can be set while establishing the entire workflow for the first time. It helps preventing unnecessary commits of sensitive data. It will print the content expected to be committed in the public repository.

Issues#

To post issues, questions, and code, go to ansys-tools-repo-sync Issues.

License#

ansys-tools-repo-sync is licensed under the MIT license.