# gerritaction
[![Actions Status](https://github.com/craftslab/gerritaction/workflows/CI/badge.svg?branch=master&event=push)](https://github.com/craftslab/gerritaction/actions?query=workflow%3ACI)
[![License](https://img.shields.io/github/license/craftslab/gerritaction.svg?color=brightgreen)](https://github.com/craftslab/gerritaction/blob/master/LICENSE)
[![PyPI](https://img.shields.io/pypi/v/gerritaction.svg?color=brightgreen)](https://pypi.org/project/gerritaction)
[![Tag](https://img.shields.io/github/tag/craftslab/gerritaction.svg?color=brightgreen)](https://github.com/craftslab/gerritaction/tags)
## Introduction
*gerritaction* is a tool used for Gerrit action via Gerrit API.
## Prerequisites
- Python >= 3.7.0
## Run
```bash
git clone https://github.com/craftslab/gerritaction.git
cd gerritaction
pip install -Ur requirements.txt
python action.py --config-file="config.yml" --change-query="since:2024-01-01 until:2024-01-02"
```
## Docker
```bash
git clone https://github.com/craftslab/gerritaction.git
cd gerritaction
docker build --no-cache -f Dockerfile -t craftslab/gerritaction:latest .
docker run -it -v /tmp:/tmp craftslab/gerritaction:latest ./gerritaction --config-file="config.yml" --change-query="since:2024-01-01 until:2024-01-02"
```
## Usage
```
usage: action.py [-h] --config-file CONFIG_FILE
[--account-query ACCOUNT_QUERY] [--change-query CHANGE_QUERY]
[--change-action CHANGE_ACTION] [--group-query GROUP_QUERY]
[--project-query PROJECT_QUERY] [--output-file OUTPUT_FILE]
[-v]
Gerrit Action
options:
-h, --help show this help message and exit
--config-file CONFIG_FILE
config file (.yml)
--account-query ACCOUNT_QUERY
account query (name:john email:example.com)
--change-query CHANGE_QUERY
change query (status:open since:2024-01-01
until:2024-01-02)
--change-action CHANGE_ACTION
change action (add-reviewer:account-id,... delete-
reviewer:account-id,... add-attention:account-id,...
remove-attention:account-id,... approve-change:Code-
Review=+2,... delete-change submit-change)
--group-query GROUP_QUERY
group query (name:admin member:john)
--project-query PROJECT_QUERY
project query (name:test state:active)
--output-file OUTPUT_FILE
output file (.json)
-v, --version show program's version number and exit
```
## Settings
*gerritaction* parameters can be set in the directory [config](https://github.com/craftslab/gerritaction/blob/master/gerritaction/config).
An example of configuration in [config.yml](https://github.com/craftslab/gerritaction/blob/master/gerritaction/config/config.yml):
```yaml
apiVersion: v1
kind: worker
metadata:
name: gerritaction
spec:
gerrit:
host: http://127.0.0.1/
port: 8080
user: user
pass: pass
```
## License
Project License can be found [here](LICENSE).
Raw data
{
"_id": null,
"home_page": "https://github.com/craftslab/gerritaction",
"name": "gerritaction",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "gerrit, action",
"author": "Jia Jia",
"author_email": "angersax@sina.com",
"download_url": "https://files.pythonhosted.org/packages/a5/39/ad7184da468d9bba08fdf10f44184a37bc37fa8a3ea576ab4f261bb6c2aa/gerritaction-1.11.0.tar.gz",
"platform": null,
"description": "# gerritaction\n\n[![Actions Status](https://github.com/craftslab/gerritaction/workflows/CI/badge.svg?branch=master&event=push)](https://github.com/craftslab/gerritaction/actions?query=workflow%3ACI)\n[![License](https://img.shields.io/github/license/craftslab/gerritaction.svg?color=brightgreen)](https://github.com/craftslab/gerritaction/blob/master/LICENSE)\n[![PyPI](https://img.shields.io/pypi/v/gerritaction.svg?color=brightgreen)](https://pypi.org/project/gerritaction)\n[![Tag](https://img.shields.io/github/tag/craftslab/gerritaction.svg?color=brightgreen)](https://github.com/craftslab/gerritaction/tags)\n\n\n\n## Introduction\n\n*gerritaction* is a tool used for Gerrit action via Gerrit API.\n\n\n\n## Prerequisites\n\n- Python >= 3.7.0\n\n\n\n## Run\n\n```bash\ngit clone https://github.com/craftslab/gerritaction.git\n\ncd gerritaction\npip install -Ur requirements.txt\npython action.py --config-file=\"config.yml\" --change-query=\"since:2024-01-01 until:2024-01-02\"\n```\n\n\n\n## Docker\n\n```bash\ngit clone https://github.com/craftslab/gerritaction.git\n\ncd gerritaction\ndocker build --no-cache -f Dockerfile -t craftslab/gerritaction:latest .\ndocker run -it -v /tmp:/tmp craftslab/gerritaction:latest ./gerritaction --config-file=\"config.yml\" --change-query=\"since:2024-01-01 until:2024-01-02\"\n```\n\n\n\n## Usage\n\n```\nusage: action.py [-h] --config-file CONFIG_FILE\n [--account-query ACCOUNT_QUERY] [--change-query CHANGE_QUERY]\n [--change-action CHANGE_ACTION] [--group-query GROUP_QUERY]\n [--project-query PROJECT_QUERY] [--output-file OUTPUT_FILE]\n [-v]\n\nGerrit Action\n\noptions:\n -h, --help show this help message and exit\n --config-file CONFIG_FILE\n config file (.yml)\n --account-query ACCOUNT_QUERY\n account query (name:john email:example.com)\n --change-query CHANGE_QUERY\n change query (status:open since:2024-01-01\n until:2024-01-02)\n --change-action CHANGE_ACTION\n change action (add-reviewer:account-id,... delete-\n reviewer:account-id,... add-attention:account-id,...\n remove-attention:account-id,... approve-change:Code-\n Review=+2,... delete-change submit-change)\n --group-query GROUP_QUERY\n group query (name:admin member:john)\n --project-query PROJECT_QUERY\n project query (name:test state:active)\n --output-file OUTPUT_FILE\n output file (.json)\n -v, --version show program's version number and exit\n```\n\n\n\n## Settings\n\n*gerritaction* parameters can be set in the directory [config](https://github.com/craftslab/gerritaction/blob/master/gerritaction/config).\n\nAn example of configuration in [config.yml](https://github.com/craftslab/gerritaction/blob/master/gerritaction/config/config.yml):\n\n```yaml\napiVersion: v1\nkind: worker\nmetadata:\n name: gerritaction\nspec:\n gerrit:\n host: http://127.0.0.1/\n port: 8080\n user: user\n pass: pass\n```\n\n\n\n## License\n\nProject License can be found [here](LICENSE).\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "Gerrit Action",
"version": "1.11.0",
"project_urls": {
"Download": "https://github.com/craftslab/gerritaction/archive/v1.11.0.tar.gz",
"Homepage": "https://github.com/craftslab/gerritaction"
},
"split_keywords": [
"gerrit",
" action"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "191b33f9418aad3993fec1a0ebd561a8ef1c6e3c1d55071e1bf8fad1bd3b5646",
"md5": "b00eeb44518914620046432f7b7474b3",
"sha256": "b3469f58b9c9f9b6cb928bd96fdb13333f42007a32dd9ad6fc8c6ab46c9c0105"
},
"downloads": -1,
"filename": "gerritaction-1.11.0-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "b00eeb44518914620046432f7b7474b3",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 14962,
"upload_time": "2024-07-09T21:28:47",
"upload_time_iso_8601": "2024-07-09T21:28:47.859432Z",
"url": "https://files.pythonhosted.org/packages/19/1b/33f9418aad3993fec1a0ebd561a8ef1c6e3c1d55071e1bf8fad1bd3b5646/gerritaction-1.11.0-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a539ad7184da468d9bba08fdf10f44184a37bc37fa8a3ea576ab4f261bb6c2aa",
"md5": "dad9a4ad04c9657b53330f80332629be",
"sha256": "361ed27e2ab2606a93aea5dab301799ec87472da4e0593b8f887b131eeddc040"
},
"downloads": -1,
"filename": "gerritaction-1.11.0.tar.gz",
"has_sig": false,
"md5_digest": "dad9a4ad04c9657b53330f80332629be",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 13706,
"upload_time": "2024-07-09T21:28:50",
"upload_time_iso_8601": "2024-07-09T21:28:50.149014Z",
"url": "https://files.pythonhosted.org/packages/a5/39/ad7184da468d9bba08fdf10f44184a37bc37fa8a3ea576ab4f261bb6c2aa/gerritaction-1.11.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-09 21:28:50",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "craftslab",
"github_project": "gerritaction",
"travis_ci": true,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "black",
"specs": []
},
{
"name": "colorama",
"specs": []
},
{
"name": "coverage",
"specs": []
},
{
"name": "coveralls",
"specs": []
},
{
"name": "flake8",
"specs": []
},
{
"name": "hypothesis",
"specs": []
},
{
"name": "mypy",
"specs": []
},
{
"name": "pre-commit",
"specs": []
},
{
"name": "pytest",
"specs": []
},
{
"name": "requests",
"specs": []
},
{
"name": "setuptools",
"specs": []
},
{
"name": "twine",
"specs": []
},
{
"name": "wheel",
"specs": []
}
],
"lcname": "gerritaction"
}