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){ } } }
.withEnvironmentName(environmentName).withVersionLabel( versionLabel); client.updateEnvironment(updateRequest); System.out.println("Update environment request submitted");
return service.updateEnvironment(req);
protected Object executeInternal() throws Exception { waitForNotUpdating(); UpdateEnvironmentRequest req = new UpdateEnvironmentRequest().withEnvironmentId(curEnv.getEnvironmentId()); req.setOptionSettings( Arrays.asList( new ConfigurationOptionSetting().withNamespace("aws:elasticbeanstalk:application:environment").withOptionName(envName).withValue(envValue))); UpdateEnvironmentResult result = getService().updateEnvironment(req); return result; } }
Object changeToVersion(EnvironmentDescription d, ApplicationVersionDescription latestVersionDescription) { String curVersionLabel = d.getVersionLabel(); String versionLabel = latestVersionDescription.getVersionLabel(); UpdateEnvironmentRequest request = new UpdateEnvironmentRequest().withEnvironmentId(d.getEnvironmentId()).withVersionLabel(versionLabel); getLog() .info( "Changing versionLabel for Environment[name=" + curEnv.getEnvironmentName() + "; environmentId=" + curEnv.getEnvironmentId() + "] from version " + curVersionLabel + " to version " + latestVersionDescription.getVersionLabel()); if (dryRun) { return null; } return getService().updateEnvironment(request); } }
protected Object executeInternal() throws MojoExecutionException, MojoFailureException { UpdateEnvironmentRequest req = new UpdateEnvironmentRequest(); req.setEnvironmentId(curEnv.getEnvironmentId()); req.setEnvironmentName(curEnv.getEnvironmentName()); if (WhatToSet.versionLabel.equals(whatToSet)) { req.setVersionLabel(versionLabel); } else if (WhatToSet.description.equals(whatToSet)) { req.setDescription(environmentDescription); } else if (WhatToSet.optionSettings.equals(whatToSet)) { req.setOptionSettings(getOptionSettings(optionSettings)); } else if (WhatToSet.templateName.equals(whatToSet)) { req.setTemplateName(lookupTemplateName(applicationName, templateName)); } else if (WhatToSet.optionsToRemove.equals(whatToSet)) { req.setOptionsToRemove(getOptionsToRemove(optionsToRemove)); } return getService().updateEnvironment(req); }