You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is already a storage.beforeCreate Plugin Execution Points that lets you implement plugins that react before artifacts are created in a repository. What we need is a plugin that reacts before a repository itself is created.
More concretely we want to restrict the names used for repositories. The idea would be something like this
import org.artifactory.exception.CancelException
storage {
beforeRepoCreate { item ->
def pattern = "(([^\\-]+)-)+(alpine|cargo|chef|cocoa|conan|conda|cran|debian|docker|gems|generic|gitlfs|go|helm|ivy|maven|npm|nuget|opkg|php|puppet|pypi|rpm|sbt|vagrant|bower)(-(prod|qa|dev))?-(local|remote)"
def repoConf = repositories.getRepositoryConfiguration(item.repoPath.repoKey)
if (!(item.repoPath.repoKey ==~ pattern)){
def message = "Repo name: " + item.repoPath.repoKey + ". "
message += "The repository name must end with -<type>-<remote|local> or -<type>-<prod|qa|dev>-<local|remote>"
def status = 400
throw new CancelException(message, status) {
public Throwable fillInStackTrace() {
return null;
}
}
}
}
}
The text was updated successfully, but these errors were encountered:
We appreciate you sending in your feature request. We value every user comment. We are closing this request for the time being, though, because it has been pending for a while and a number of plugins have been deprecated in the most recent releases. Please revisit it or submit a new request with the most recent information if you have any changes or believe that this feature is still necessary.
There is already a storage.beforeCreate Plugin Execution Points that lets you implement plugins that react before artifacts are created in a repository. What we need is a plugin that reacts before a repository itself is created.
More concretely we want to restrict the names used for repositories. The idea would be something like this
The text was updated successfully, but these errors were encountered: