Skip to content

About

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.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

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 <pipeline_id> after replacing <pipeline_id> 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 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 to get the project ID for your project.

About

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.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Contributors

Languages