https://github.com/aarabdh/retry-pipelines
Simple python tool with no dependencies that can be used to retry failing pipelines in your gitlab build. Useful for flakey tests that are preventing your merge request.
https://github.com/aarabdh/retry-pipelines
gitlab gitlab-api gitlab-ci gitlab-tool pipeline python python3 tool
Last synced: 21 days ago
JSON representation
Simple python tool with no dependencies that can be used to retry failing pipelines in your gitlab build. Useful for flakey tests that are preventing your merge request.
- Host: GitHub
- URL: https://github.com/aarabdh/retry-pipelines
- Owner: aarabdh
- Created: 2025-02-05T12:16:34.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-05T14:13:26.000Z (over 1 year ago)
- Last Synced: 2025-07-25T08:59:36.394Z (10 months ago)
- Topics: gitlab, gitlab-api, gitlab-ci, gitlab-tool, pipeline, python, python3, tool
- Language: Python
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Retry Pipelines
Simple python tool that can be used to retry failing pipelines in your Gitlab build. Useful for flakey tests that are preventing your merge request.
### Usage:
#### First-time setup:
1. Clone the project
2. Create a .env file inside the project directory.
3. Copy the contents of example.env to the newly created .env file, then update the variables as expected.
4. Save the .env file.
5. Run `pip install -r requirements.txt`.
6. The script is ready. Run `python RetryPipeline.py -h` to see usage options.
#### Regular use:
1. Get the Pipeline ID from the Gitlab UI or URL. It is a # followed by some number. This is the pipeline that will be retried.
2. Open terminal in the folder where RetryPipeline.py is saved.
3. Run `python RetryPipeline.py ` after replacing `` with your Pipeline ID or URL.
(You can also run `python RetryPipeline.py` directly, you will be prompted for pipeline ID or URL while the project executes.)
#### Optional steps to enable colorful text:
1. Run `pip install -r requirements-optional.txt`.
2. Open RetryPipeline.py and set PRETTY_PRINT_FLAG to `True`.
3. Save RetryPipeline.py
### Resources:
Use [this tutorial](https://www.merge.dev/blog/gitlab-access-token) to get your Personal Access Token for Gitlab. Make sure to use the scope "api", otherwise the retry functionality won't work.
Use [this method](https://docs.gitlab.com/ee/user/project/working_with_projects.html#access-a-project-by-using-the-project-id) to get the project ID for your project.