Package org.jclouds.scriptbuilder.domain

Examples of org.jclouds.scriptbuilder.domain.StatementList


      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


      }
      if (updateExistingGems) {
         statements.add(exec("gem update --no-rdoc --no-ri"));
      }

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

            extractTargzAndFlattenIntoDirectory(JETTY_URL, JETTY_HOME),
            exec("chown -R web " + JETTY_HOME));
   }

   private static Statement authorizePortInIpTables() {
      return new StatementList(
            exec("iptables -I INPUT 1 -p tcp --dport " + port + " -j ACCEPT"),
            exec("iptables-save"));
   }
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

      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

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.