List of usage examples for com.amazonaws.services.elasticbeanstalk.model EventDescription getMessage
public String getMessage()
The event message.
From source file:jetbrains.buildServer.runner.elasticbeanstalk.AWSClient.java
License:Apache License
private void waitForDeployment(@NotNull String environmentId, String versionLabel, long startTime, int waitTimeoutSec, int waitIntervalSec) { myListener.deploymentWaitStarted(getEnvironment(environmentId).getEnvironmentName()); EnvironmentDescription environment;//from w w w . j av a 2s. c o m String status; List<EventDescription> newEvents; List<EventDescription> errorEvents; boolean hasError; Date startDate = new Date(startTime); while (true) { environment = getEnvironment(environmentId); myListener.deploymentInProgress(environment.getEnvironmentName()); status = getHumanReadableStatus(environment.getStatus()); newEvents = getNewEvents(environmentId, startDate); for (EventDescription event : newEvents) { myListener.deploymentUpdate(event.getMessage()); } if (System.currentTimeMillis() - startTime > waitTimeoutSec * 1000) { myListener.deploymentFailed(environment.getApplicationName(), environment.getEnvironmentName(), versionLabel, true, null); return; } errorEvents = getErrorEvents(environmentId, versionLabel); hasError = errorEvents.size() > 0; if (!status.equals("updating") || hasError) { break; } try { Thread.sleep(waitIntervalSec * 1000); } catch (InterruptedException e) { processFailure(e); return; } } if (isSuccess(environment, versionLabel)) { myListener.deploymentSucceeded(versionLabel); } else { Listener.ErrorInfo errorEvent = hasError ? getErrorInfo(errorEvents.get(0)) : null; myListener.deploymentFailed(environment.getApplicationName(), environment.getEnvironmentName(), versionLabel, false, errorEvent); } }
From source file:jetbrains.buildServer.runner.elasticbeanstalk.AWSClient.java
License:Apache License
@NotNull private Listener.ErrorInfo getErrorInfo(@NotNull EventDescription event) { final Listener.ErrorInfo errorInfo = new Listener.ErrorInfo(); errorInfo.message = removeTrailingDot(event.getMessage()); errorInfo.severity = event.getSeverity(); return errorInfo; }