Examples of WaitForEnvironmentCommand


Examples of br.com.ingenieux.mojo.beanstalk.cmd.env.waitfor.WaitForEnvironmentCommand

        .withApplicationName(applicationName)
        .withStatusToWaitFor("Ready").withEnvironmentRef(environmentId)
                .withHealth("Green")
        .withTimeoutMins(timeoutMins).build();

    WaitForEnvironmentCommand command = new WaitForEnvironmentCommand(this);

    return command.execute(context);
  }
View Full Code Here

Examples of br.com.ingenieux.mojo.beanstalk.cmd.env.waitfor.WaitForEnvironmentCommand

          .withStatusToWaitFor("Ready")//
          .withEnvironmentId(newEnvironmentId)//
          .withTimeoutMins(timeoutMins)//
          .withDomainToWaitFor(cnamePrefix).build();

      WaitForEnvironmentCommand command = new WaitForEnvironmentCommand(this);

      command.execute(context);
    }
  }
View Full Code Here

Examples of br.com.ingenieux.mojo.beanstalk.cmd.env.waitfor.WaitForEnvironmentCommand

      WaitForEnvironmentContext context = new WaitForEnvironmentContextBuilder()
          .withApplicationName(applicationName)
          .withEnvironmentId(environmentId).withStatusToWaitFor("Terminated")
          .withTimeoutMins(timeoutMins).build();

      WaitForEnvironmentCommand command = new WaitForEnvironmentCommand(this);

      command.execute(context);
    }
  }
View Full Code Here

Examples of br.com.ingenieux.mojo.beanstalk.cmd.env.waitfor.WaitForEnvironmentCommand

    WaitForEnvironmentContext context = new WaitForEnvironmentContextBuilder()
        .withApplicationName(applicationName).withStatusToWaitFor("Ready")
        .withEnvironmentId(environmentId).withTimeoutMins(timeoutMins).build();

    WaitForEnvironmentCommand command = new WaitForEnvironmentCommand(this);

    return command.execute(context);
  }
View Full Code Here

Examples of br.com.ingenieux.mojo.beanstalk.cmd.env.waitfor.WaitForEnvironmentCommand

        .withStatusToWaitFor(statusToWaitFor)//
        .withDomainToWaitFor(cnamePrefix)//
        .withTimeoutMins(timeoutMins)
        .build();

    WaitForEnvironmentCommand command = new WaitForEnvironmentCommand(this);

    return command.execute(context);
  }
View Full Code Here

Examples of br.com.ingenieux.mojo.beanstalk.cmd.env.waitfor.WaitForEnvironmentCommand

            .withStatusToWaitFor("!Updating")//
            .withTimeoutMins(2)//
                        .withEnvironmentRef(environmentRef)//
                        .build();

        WaitForEnvironmentCommand command = new WaitForEnvironmentCommand(this);
     
        command.execute(context);
      }
View Full Code Here

Examples of br.com.ingenieux.mojo.beanstalk.cmd.env.waitfor.WaitForEnvironmentCommand

    protected Object executeInternal() throws Exception {
        versionLabel = lookupVersionLabel(applicationName, versionLabel);

        getLog().info(format("Using version %s", versionLabel));

        Collection<EnvironmentDescription> envs = new WaitForEnvironmentCommand(this).lookupInternal(new WaitForEnvironmentContextBuilder().withApplicationName(applicationName).withEnvironmentRef(environmentNamePrefix + "*").build());

        if (2 != envs.size()) {
            final Collection<String> environmentList = Collections2.transform(envs, new Function<EnvironmentDescription, String>() {
                @Override
                public String apply(EnvironmentDescription input) {
                    return format("%s[%s]", input.getEnvironmentId(), input.getEnvironmentName());
                }
            });

            String message = "Ooops. There are multiple environments matching the lookup spec: " + environmentList;

            getLog().warn(message);

            throw new MojoFailureException(message);
        }

        String otherEnvId = null;
        for (EnvironmentDescription e : envs) {
            if (! e.getEnvironmentId().equals(curEnv.getEnvironmentId())) {
                otherEnvId = e.getEnvironmentId();
                break;
            }
        }

        getLog().info(format("(Green) Environment with environmentId['%s'] will be prepared once its ready to update", curEnv.getEnvironmentId()));

        new WaitForEnvironmentCommand(this).execute(new WaitForEnvironmentContextBuilder().withStatusToWaitFor("Ready").withApplicationName(applicationName).withEnvironmentRef(curEnv.getEnvironmentId()).build());

        getLog().info(format("(Blue) Environment with environmentId['%s'] will be prepared once its ready to update", otherEnvId));

        new WaitForEnvironmentCommand(this).execute(new WaitForEnvironmentContextBuilder().withStatusToWaitFor("Ready").withApplicationName(applicationName).withEnvironmentRef(otherEnvId).build());

        getLog().info(format("(Blue) Updating environmentId to version %s", versionLabel));

        new UpdateEnvironmentCommand(this).execute(new UpdateEnvironmentContextBuilder().withEnvironmentId(otherEnvId).withVersionLabel(versionLabel).build());

        getLog().info(format("(Blue) Waiting for environmentId['%s'] to get ready and green prior to switching", otherEnvId));

        new WaitForEnvironmentCommand(this).execute(new WaitForEnvironmentContextBuilder().withStatusToWaitFor("Ready").withApplicationName(applicationName).withHealth("Green").withEnvironmentRef(otherEnvId).build());

        getLog().info(format("Ok. Switching"));

        getService().swapEnvironmentCNAMEs(new SwapEnvironmentCNAMEsRequest().withDestinationEnvironmentId(curEnv.getEnvironmentId()).withSourceEnvironmentId(otherEnvId));

View Full Code Here

Examples of br.com.ingenieux.mojo.beanstalk.cmd.env.waitfor.WaitForEnvironmentCommand

        return Arrays.asList(arrOptionSettings);
    }

    protected EnvironmentDescription lookupEnvironment(String applicationName, String environmentRef) throws MojoExecutionException {
        final WaitForEnvironmentContext ctx = new WaitForEnvironmentContextBuilder().withApplicationName(applicationName).withEnvironmentRef(environmentRef).build();
        final Collection<EnvironmentDescription> environments = new WaitForEnvironmentCommand(this).lookupInternal(ctx);
        return handleResults(environments);
    }
View Full Code Here

Examples of br.com.ingenieux.mojo.beanstalk.cmd.env.waitfor.WaitForEnvironmentCommand

          .withApplicationName(result.getApplicationName())//
          .withHealth("Green")//
          .withStatusToWaitFor("Ready")//
          .build();

      new WaitForEnvironmentCommand(this).execute(ctx);
    }
   
    return result;
  }
View Full Code Here

Examples of br.com.ingenieux.mojo.beanstalk.cmd.env.waitfor.WaitForEnvironmentCommand

          .withStatusToWaitFor("Ready")//
          .withEnvironmentRef(newEnvironmentId)//
          .withTimeoutMins(timeoutMins)//
          .build();

      WaitForEnvironmentCommand command = new WaitForEnvironmentCommand(
          this);

      command.execute(context);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.