Skip to content

Instantly share code, notes, and snippets.

View mryan43's full-sized avatar
🐣

Manuel Ryan mryan43

🐣
View GitHub Profile
@mryan43
mryan43 / gist:f160fb29cbad0da169fe007735c7307b
Created August 14, 2017 06:36
Nexus 3 script delete images not downloaded since X months.
import groovy.time.TimeCategory
import org.sonatype.nexus.repository.storage.Asset
import org.sonatype.nexus.repository.storage.Component
import org.sonatype.nexus.repository.storage.Query
import org.sonatype.nexus.repository.storage.StorageFacet
def repo = repository.repositoryManager.get("sq-docker")
StorageFacet storageFacet = repo.facet(StorageFacet)
def tx = storageFacet.txSupplier().get()
node('yona'){
stage('Build'){
...
}
}
stage('Decide tag on Docker Hub'){
env.TAG_ON_DOCKER_HUB = input message: 'User input required',
parameters: [choice(name: 'Tag on Docker Hub', choices: 'no\nyes', description: 'Choose "yes" if you want to deploy this build')]
}
if (env.TAG_ON_DOCKER_HUB == 'yes'){
ruby_block "Wait for the broker to finish starting up" do
block do
attempts = 0
while (attempts < 120)
res = Chef::ShellOut.new("cat /logs/jmsbroker.log | grep B1039")
res.run_command
if (res.exitstatus == 0)
break
end
attempts += 1