public void uploadWar(String warFile, String versionLabel, String applicationName, String envName, int timeout) { prepareWar(new File(warFile), versionLabel, applicationName); journal.log(Level.INFO, ">> Uploading War file!"); while(timeout-- > 0){ System.out.print("-"); try { Thread.sleep(1000); } catch (InterruptedException ex) { Logger.getLogger(BeanstalkConnector.class.getName()).log(Level.SEVERE, null, ex); } try{ UpdateEnvironmentResult updateEnvironment = beanstalkClient.updateEnvironment(new UpdateEnvironmentRequest() .withEnvironmentName(envName) .withVersionLabel(versionLabel)); journal.log(Level.INFO, ">> War uploaded!"); break; } catch(com.amazonaws.AmazonServiceException e){ } } }
/** * Update this environment with a new version. * @param version The version to update to */ public void update(final Version version) { final UpdateEnvironmentResult res = this.client.updateEnvironment( new UpdateEnvironmentRequest() .withEnvironmentId(this.eid) .withVersionLabel(version.label()) ); Logger.info( this, "Environment '%s' updated to '%s'", res.getEnvironmentId(), res.getVersionLabel() ); }
public static void dump(UpdateEnvironmentResult uer, Log log) { log.info(" ApplicationName : " + uer.getApplicationName()); log.info(" EnvironmentId : " + uer.getEnvironmentId()); log.info(" EnvironmentName : " + uer.getEnvironmentName()); log.info(" VersionLabel : " + uer.getVersionLabel()); log.info(" Status : " + uer.getStatus()); log.info(" Health : " + uer.getHealth()); }