Using the parameter `--pipelines-keep-per-tag` (or variable `$PIPELINES_KEEP_PER_TAG`), user can specify the number of pipelines which are kept for each tag.
The `--pipelines-keep-per-tag` option (or variable `$PIPELINES_KEEP_PER_BRANCH`) allows to specify the number of pipelines kept for each branch.
The `--pipelines-keep-per-tag` option (or variable `$PIPELINES_KEEP_PER_TAG`) allows to specify the number of pipelines kept for each tag.
Example: the following options will keep up to 20 pipelines from the `latest` tag, 10 pipelines from the `stable` tag, 1 from each `v1.*`, `v2.*` tags
```bash
gitlab-butler --group-path to-be-continuous \
--pipelines-keep-per-tag latest:20 \
--pipelines-keep-per-tag stable:10 \
--pipelines-keep-per-tag v1.*:1 \
--pipelines-keep-per-tag v2.*:1
```
#### Merge-Requests
Using the parameter `--pipelines-keep-per-mr` (or variable `$PIPELINES_KEEP_PER_MR`), user can specify the number of pipelines which are kept for each merge-request.
The `--pipelines-keep-per-branch` option (or variable `$PIPELINES_KEEP_PER_BRANCH`) allows to specify the number of pipelines kept for each branch.
:warning: This parameter affect the pipelines linked to the merge-request only, not the pipelines linked to the merge-request source branch.
f"- Number of pipelines to keep per branch (--pipelines-keep-per-branch) : {AnsiColors.CYAN}{', '.join(args.pipelines_keep_per_branch)}{AnsiColors.RESET}"
)
print(
f"- Number of pipelines to keep per tag (--pipelines-keep-per-tag) : {AnsiColors.CYAN}{args.pipelines_keep_per_tag}{AnsiColors.RESET}"
f"- Number of pipelines to keep per tag (--pipelines-keep-per-tag) : {AnsiColors.CYAN}{', '.join(args.pipelines_keep_per_tag)}{AnsiColors.RESET}"
)
print(
f"- Number of pipelines to keep per MR (--pipelines-keep-per-mr) : {AnsiColors.CYAN}{args.pipelines_keep_per_mr}{AnsiColors.RESET}"