Groovy web console

subscribe to the feed Subscribe
to this
site
What machine will be updated (via #groovywebconsole)
tweet this snippet Tweet
this
script

What machine will be updated

Published 1 month ago by ReneAtAround
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
int NUMBER_OF_MACHINES = 2
int dayOfYear = Calendar.getInstance().get(Calendar.DAY_OF_YEAR)
print "machineTarget = build${1 + ((1 + dayOfYear) % NUMBER_OF_MACHINES)}"
print "machineSource = build${1 + (dayOfYear % NUMBER_OF_MACHINES)}"