Package org.jclouds.scriptbuilder.domain

Examples of org.jclouds.scriptbuilder.domain.StatementList


      /**
       * @see InitScript#getRun()
       */
      public Builder run(Iterable<Statement> run) {
         this.run = new StatementList(checkNotNull(run, "run"));
         return this;
      }
View Full Code Here


      /**
       * @see InitScript#getInit()
       */
      public Builder init(Statement init) {
         this.init = new StatementList(checkNotNull(init, "init"));
         return this;
      }
View Full Code Here

      /**
       * @see InitScript#getInit()
       */
      public Builder init(Statement... init) {
         this.init = new StatementList(checkNotNull(init, "init"));
         return this;
      }
View Full Code Here

      /**
       * @see InitScript#getInit()
       */
      public Builder init(Iterable<Statement> init) {
         this.init = new StatementList(checkNotNull(init, "init"));
         return this;
      }
View Full Code Here

    sitePp.add("}");

    statements.add(appendFile(SITE_PP_FILE_LOCATION, sitePp.build()));
    statements.add(exec("puppet apply " + SITE_PP_FILE_LOCATION));

    return new StatementList(statements.build()).render(arg0);
  }
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

      if (options.getPrivateKey() != null)
         bootstrap.add(new InstallRSAPrivateKey(options.getPrivateKey()));
      if (bootstrap.size() >= 1) {
         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

            exec("iptables -I INPUT 1 -p tcp --dport " + port + " -j ACCEPT"),
            exec("iptables-save"));
   }
  
   public static Statement start() {
      return new StatementList(
            literal("cd " + JETTY_HOME),
            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
   }
View Full Code Here

            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

   public static Statement version() {
      return exec(String.format("head -1 %s/VERSION.txt | cut -f1 -d ' '", JETTY_HOME));
   }

   public static Statement install() {
      return new StatementList(
            AdminAccess.builder().adminUsername("web").build(),
            InstallJDK.fromOpenJDK(),
            authorizePortInIpTables(),
            extractTargzAndFlattenIntoDirectory(JETTY_URL, JETTY_HOME),
            exec("chown -R web " + JETTY_HOME));
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.