Exemplo n.º 1
0
  public JobStopCommand(Subparser parser) {
    super(parser);

    parser.help("stop a running job without undeploying it");

    hostsArg = parser.addArgument("hosts").nargs("+").help("The hosts to stop the job on.");
  }
Exemplo n.º 2
0
  public HostRegisterCommand(final Subparser parser) {
    super(parser);

    parser.help("register a host");

    hostArg = parser.addArgument("host");
    idArg = parser.addArgument("id");
  }
Exemplo n.º 3
0
  @Override
  public void configureParser(Subparser parser) {
    parser.help(DESCRIPTION);
    parser.description(DESCRIPTION);

    Argument functionsArg = parser.addArgument(FUNCTIONS_ARG);
    functionsArg.dest(FUNCTIONS_ARG);
    functionsArg.metavar("<function>");
    functionsArg.nargs("*");
    functionsArg.help("function to invoke");
  }
Exemplo n.º 4
0
  @VisibleForTesting
  RollingUpdateCommand(
      final Subparser parser,
      final SleepFunction sleepFunction,
      final Supplier<Long> timeSupplier) {
    super(parser, true);

    this.sleepFunction = sleepFunction;
    this.timeSupplier = timeSupplier;

    parser.help("Initiate a rolling update");

    nameArg =
        parser.addArgument("deployment-group-name").required(true).help("Deployment group name");

    timeoutArg =
        parser
            .addArgument("-t", "--timeout")
            .setDefault(RolloutOptions.DEFAULT_TIMEOUT)
            .type(Long.class)
            .help("Fail rollout if a job takes longer than this to reach RUNNING (seconds)");

    parallelismArg =
        parser
            .addArgument("-p", "--par")
            .dest("parallelism")
            .setDefault(RolloutOptions.DEFAULT_PARALLELISM)
            .type(Integer.class)
            .help("Number of hosts to deploy to concurrently");

    asyncArg =
        parser
            .addArgument("--async")
            .action(storeTrue())
            .help("Don't block until rolling-update is complete");

    rolloutTimeoutArg =
        parser
            .addArgument("-T", "--rollout-timeout")
            .setDefault(60L)
            .type(Long.class)
            .help(
                "Exit if rolling-update takes longer than the given value (minutes). Note that "
                    + "this will NOT abort the rolling update, it will just cause this command to exit.");

    migrateArg =
        parser
            .addArgument("--migrate")
            .setDefault(false)
            .action(storeTrue())
            .help(
                "When specified a rolling-update will undeploy not only jobs previously deployed "
                    + "by the deployment-group but also jobs with the same job id. Use it ONCE when "
                    + "migrating a service to using deployment-groups");

    overlapArg =
        parser
            .addArgument("--overlap")
            .setDefault(false)
            .action(storeTrue())
            .help(
                "When specified a rolling-update will, for every host, first deploy the new "
                    + "version of a job before undeploying the old one. Note that the command will fail "
                    + "if the job contains static port assignments.");

    tokenArg =
        parser
            .addArgument("--token")
            .nargs("?")
            .setDefault(EMPTY_TOKEN)
            .help(
                "Insecure access token meant to prevent accidental changes to your job "
                    + "(e.g. undeploys).");
  }