Groovy web console

subscribe to the feed Subscribe
to this
site
WhichMachine (via #groovywebconsole)
tweet this snippet Tweet
this
script

WhichMachine

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)}\n"
print "machineSource = build${1 + (dayOfYear % NUMBER_OF_MACHINES)}"