Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibility to use Regex #111

Closed
BlazeF35 opened this issue Jun 12, 2023 · 5 comments · Fixed by #118
Closed

Possibility to use Regex #111

BlazeF35 opened this issue Jun 12, 2023 · 5 comments · Fixed by #118
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@BlazeF35
Copy link

BlazeF35 commented Jun 12, 2023

It would be interesting if there was the possibility of using regex when configuring a rule in the artifactory-cleanup.yaml file, as in the example below:

 - rule: IncludeFilename
  masks: 
   - "*/production-[0-9]+"
   - "*.develop-[0-9]+"

That way I believe you would have more control over what you want to look for in a repository.

@felipecrs
Copy link

That would be super helpful for deleting draft PR docker images, for example:

- rule: IncludeFilename
  masks: 
    - ".*/pr-[0-9]+"

@allburov
Copy link
Member

Doesn't it works for your cases? It includes [0-9]+ as well

- rule: IncludeFilename
  masks: 
   - "*production-*"
   - "*develop-*"

Feel free to create a PR for the feature if it doesn't!

@allburov allburov added enhancement New feature or request help wanted Extra attention is needed labels Jun 15, 2023
@felipecrs
Copy link

felipecrs commented Jun 15, 2023

Yes, but I would like a bit more control over what to exclude. In the example above I wanted it to match only pr-12, pr-134, but not pr-something. Similarly it would be nice to have control over uppercase and lowercase, and also quantity of characters, so I could write some regex like [a-z0-9]{40} (an artifact tagged with a git SHA1 for example.

@Hardar3
Copy link
Contributor

Hardar3 commented Sep 23, 2023

I think that the removal of artifacts by regex will be possible after #118

@allburov
Copy link
Member

The rule is available in 1.0.8. thanks to @Hardar3 🥇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Development

Successfully merging a pull request may close this issue.

4 participants