Package org.jclouds.scriptbuilder.domain

Examples of org.jclouds.scriptbuilder.domain.StatementList


            literal("nohup java -jar start.jar jetty.port=" + port + " > start.out 2> start.err < /dev/null &"),
            literal("test $? && sleep 1")); // in case it is slow starting the proc
   }
  
   public static Statement stop() {
      return new StatementList(
            literal("cd " + JETTY_HOME),
            literal("./bin/jetty.sh stop"));
   }
View Full Code Here


      }

      String strOptions = Joiner.on(' ').withKeyValueSeparator(" ").join(options.build());
      statements.add(Statements.exec(String.format("chef-solo %s", strOptions)));

      return new StatementList(statements.build()).render(family);
   }
View Full Code Here

      if (config.shouldLockSsh())
         statements.add(lockSshd());
      if (config.shouldResetLoginPassword()) {
         statements.add(resetLoginUserPasswordTo(config.getCryptFunction(), config.getLoginPassword()));
      }
      return new StatementList(statements.build()).render(family);
   }
View Full Code Here

      TemplateOptionsToStatementWithoutPublicKey function = new TemplateOptionsToStatementWithoutPublicKey();
      Statement statement = function.apply(options);

      assertTrue(statement instanceof StatementList);
      StatementList statements = (StatementList) statement;

      assertEquals(statements.size(), 2);
      assertEquals(statements.get(0).render(OsFamily.UNIX), "uptime\n");
      assertTrue(statements.get(1) instanceof InstallRSAPrivateKey);
   }
View Full Code Here

      ImmutableList<Statement> bootstrap = builder.build();
      if (!bootstrap.isEmpty()) {
         if (options.getTaskName() == null && !(options.getRunScript() instanceof InitScript)) {
            options.nameTask("bootstrap");
         }
         return bootstrap.size() == 1 ? bootstrap.get(0) : new StatementList(bootstrap);
      }

      return null;
   }
View Full Code Here

   @Named(ComputeServiceConstants.COMPUTE_LOGGER)
   protected Logger logger = Logger.NULL;
   private final StatementList statements;

   public InstallGuestAdditions(VmSpec vmSpecification, String vboxVersion) {
      this.statements = new StatementList(getStatements(vmSpecification, vboxVersion));
   }
View Full Code Here

            iface = "eth3";
            break;
         default:
            throw new IllegalArgumentException("slot must be 0,1,2,3 (was: " + slot + ")");
      }
      this.statements = new StatementList(getStatements(iface));
   }
View Full Code Here

         throw new RuntimeException("could not connect to virtualbox");
      }
      File file = new File(isosDir, fileName);
      List<Statement> statements = new ImmutableList.Builder<Statement>().add(
            Statements.saveHttpResponseTo(URI.create(httpUrl), isosDir, fileName)).build();
      StatementList statementList = new StatementList(statements);
      NodeMetadata hostNode = checkNotNull(hardcodedHostToHostNodeMetadata.apply(host.get()), "hostNode");
      ListenableFuture<ExecResponse> future = runScriptOnNodeFactory.submit(hostNode, statementList,
            runAsRoot(false));
      Futures.getUnchecked(future);
View Full Code Here

      URI provider = providerSupplier.get();
      NodeMetadata hostNodeMetadata = hardcodedHostToHostNodeMetadata.apply(host.get());
      List<Statement> statements = new ImmutableList.Builder<Statement>()
            .add(findPid("vboxwebsrv"))
            .add(kill()).build();
      StatementList statementList = new StatementList(statements);

      if (socketTester.apply(HostAndPort.fromParts(provider.getHost(), provider.getPort()))) {
         logger.debug(String.format("shutting down previously started vboxwewbsrv at %s", provider));
         ExecResponse execResponse = runScriptOnNodeFactory.create(hostNodeMetadata, statementList, runAsRoot(false))
               .init().call();
View Full Code Here

      if (family == OsFamily.WINDOWS)
         throw new UnsupportedOperationException("windows not yet implemented");
      Builder<Statement> statements = ImmutableList.builder();
      statements.add(createOrOverwriteFile(sudoers, ImmutableSet.of("root ALL = (ALL) ALL", "%wheel ALL = (ALL) NOPASSWD:ALL")));
      statements.add(exec("chmod 0440 " + sudoers));
      return new StatementList(statements.build()).render(family);
   }
View Full Code Here

TOP

Related Classes of org.jclouds.scriptbuilder.domain.StatementList

Copyright © 2018 www.massapicom. 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.