CLC-1220 Move upgrade function from calcentral into its own script, and use it from deploy.rb