Jenkins/vars/lolops.groovy

32 lines
1.8 KiB
Groovy
Raw Normal View History

2020-03-04 16:51:30 +01:00
def getRandomDeliveryAttachment(Integer probability = 25) {
def deliveryImages = [
'https://media.giphy.com/media/UtM8DmnahknE4/giphy.gif',
2020-03-07 10:30:15 +01:00
'https://media.giphy.com/media/11VKF3OwuGHzNe/giphy.gif',
'https://media.giphy.com/media/d5pGYhWb3T1Hyyl8OB/giphy.gif',
'https://media.giphy.com/media/oTSy3rHigPd9S/giphy.gif',
'https://media.giphy.com/media/9DgxhWOxHDHtF8bvwl/giphy.gif',
'https://media.giphy.com/media/9DgxhWOxHDHtF8bvwl/giphy.gif',
'https://media.giphy.com/media/1g2JyW7p6mtZc6bOEY/giphy.gif',
'https://media.giphy.com/media/7AqsdBK15kiOc/giphy.gif',
2020-03-18 23:18:27 +01:00
'https://media.giphy.com/media/r2MkQEOe7niGk/giphy.gif',
'https://media.giphy.com/media/ekXyB3lQ0IYL3luIFn/giphy.gif',
'https://media.giphy.com/media/QBRlXHKV5mpbLJ4prc/giphy.gif',
'https://media.giphy.com/media/NOsfNQGivMFry/giphy.gif',
'https://media.giphy.com/media/M1vu1FJnW6gms/giphy.gif',
2020-11-13 09:41:33 +01:00
'https://media.giphy.com/media/555x0gFF89OhVWPkvb/giphy.gif',
'https://media.giphy.com/media/9RZu6ahd8LIYHQlGUD/giphy.gif',
'https://media.giphy.com/media/9RZu6ahd8LIYHQlGUD/giphy.gif',
'https://media.giphy.com/media/W1fFHj6LvyTgfBNdiz/giphy.gif',
'https://media.giphy.com/media/1g2JyW7p6mtZc6bOEY/giphy.gif',
'https://media.giphy.com/media/ORiFE3ijpNaIWDoOqP/giphy.gif',
'https://media.giphy.com/media/r16Zmuvt1hSTK/giphy.gif',
'https://media.giphy.com/media/bF8Tvy2Ta0mqxXgaPV/giphy.gif',
'https://media.giphy.com/media/C0XT6BmLC3nGg/giphy.gif'
2020-03-04 16:51:30 +01:00
]
Random rnd = new Random()
2020-03-07 10:30:15 +01:00
if (rnd.nextInt(100) > probability) {
2020-03-04 16:51:30 +01:00
return [];
}
def imageUrl = deliveryImages[rnd.nextInt(deliveryImages.size())]
return [[title: '', imageUrl: imageUrl]];
}