Package org.jclouds.scriptbuilder.domain

Examples of org.jclouds.scriptbuilder.domain.StatementList


   public static ScriptBuilder makeInitScriptStatement(String instanceName, String instanceHome, String logDir,
         Map<String, String> exports, StatementList init, StatementList run) {
      Map<String, String> defaultExports = ImmutableMap.of("INSTANCE_NAME", instanceName, "INSTANCE_HOME", instanceHome,
            "LOG_DIR", logDir);
      String exitStatusFile = format("%s/rc", logDir);
      run = new StatementList(ImmutableList.<Statement> builder().add(interpret("rm -f " + exitStatusFile))
            .add(interpret(format("trap 'echo $?>%s' 0 1 2 3 15", exitStatusFile))).addAll(run.delegate()).build());

      CreateRunScript createRunScript = createRunScript(instanceName,
            concat(exports.keySet(), defaultExports.keySet()), "{varl}INSTANCE_HOME{varr}", run);
View Full Code Here


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

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

      /**
       * @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

      statements.add(exec("{md} " + sshDir));
      String idRsa = sshDir + "{fs}id_rsa";
      statements.add(exec("{rm} " + idRsa));
      statements.add(appendFile(idRsa, Splitter.on('\n').split(privateKey)));
      statements.add(exec("chmod 600 " + idRsa));
      return new StatementList(statements.build()).render(family);
   }
View Full Code Here

      Builder<Statement> statements = ImmutableList.builder();
      statements.add(exec("mkdir -p " + sshDir));
      String authorizedKeys = sshDir + "{fs}authorized_keys";
      statements.add(appendFile(authorizedKeys, Splitter.on('\n').split(Joiner.on("\n\n").join(publicKeys))));
      statements.add(exec("chmod 600 " + authorizedKeys));
      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

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.