This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import groovyx.net.http.*; | |
| import static groovyx.net.http.ContentType.*; | |
| import static groovyx.net.http.Method.*; | |
| class NexusArtifactCleanup { | |
| /** | |
| * Settings in which to run script. | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import groovy.json.JsonSlurper | |
| import org.sonatype.nexus.repository.storage.Asset | |
| import org.sonatype.nexus.repository.storage.StorageFacet | |
| def DOCKER_REPOSITORY_NAME = 'docker-hosted' | |
| def dockerRepository = repository.repositoryManager.get(DOCKER_REPOSITORY_NAME) | |
| def dockerBlobStore = blobStore.blobStoreManager.get(dockerRepository.configuration.attributes.storage.blobStoreName) | |
| def storageTx = dockerRepository.facet(StorageFacet.class).txSupplier().get() | |
| try { |