Examples of executeCommand()


Examples of org.platformlayer.ops.OpsTarget.executeCommand()

      // Get this onto disk now, so we don't delay later commands
      target.executeCommand(Command.build("sync").setTimeout(TimeSpan.FIVE_MINUTES));

      // Mount on mnt/
      File mntDir = new File(tempDir, "mnt");
      target.executeCommand("mkdir {0}", mntDir);

      target.executeCommand(Command.build("mount {0} {1}", loopbackPartition, mntDir).setTimeout(
          TimeSpan.FIVE_MINUTES));

      rootfsDir = mntDir;
View Full Code Here

Examples of org.platformlayer.ops.OpsTarget.executeCommand()

      // Mount on mnt/
      File mntDir = new File(tempDir, "mnt");
      target.executeCommand("mkdir {0}", mntDir);

      target.executeCommand(Command.build("mount {0} {1}", loopbackPartition, mntDir).setTimeout(
          TimeSpan.FIVE_MINUTES));

      rootfsDir = mntDir;
    } else {
      rootfsDir = new File(tempDir, "rootfs");
View Full Code Here

Examples of org.platformlayer.ops.OpsTarget.executeCommand()

    command.setEnvironment(httpProxyEnv);

    command.setTimeout(TimeSpan.THIRTY_MINUTES);

    try {
      target.executeCommand(command);
    } catch (ProcessExecutionException e) {
      String debootstrapLog = target.readTextFile(new File(rootfsDir, "debootstrap/debootstrap.log"));
      log.warn("Debootstrap log: " + debootstrapLog);

      throw new OpsException("Error running debootstrap", e);
View Full Code Here

Examples of org.platformlayer.ops.OpsTarget.executeCommand()

      File policyFile = new File(rootfsDir, "usr/sbin/policy-rc.d");
      FileUpload.upload(target, policyFile, policy);
      target.chmod(policyFile, "755");
    }

    target.executeCommand("mount -t proc proc {0}", new File(rootfsDir, "proc"));

    apt.update(chrootTarget, true);
    target.executeCommand("chroot {0} locale-gen en_US.utf8", rootfsDir);

    target.executeCommand("chroot {0} /bin/bash -c \"DEBIAN_FRONTEND=noninteractive dpkg-reconfigure locales\"",
View Full Code Here

Examples of org.platformlayer.ops.OpsTarget.executeCommand()

    }

    target.executeCommand("mount -t proc proc {0}", new File(rootfsDir, "proc"));

    apt.update(chrootTarget, true);
    target.executeCommand("chroot {0} locale-gen en_US.utf8", rootfsDir);

    target.executeCommand("chroot {0} /bin/bash -c \"DEBIAN_FRONTEND=noninteractive dpkg-reconfigure locales\"",
        rootfsDir);

    if (!buildTar) {
View Full Code Here

Examples of org.platformlayer.ops.OpsTarget.executeCommand()

    target.executeCommand("mount -t proc proc {0}", new File(rootfsDir, "proc"));

    apt.update(chrootTarget, true);
    target.executeCommand("chroot {0} locale-gen en_US.utf8", rootfsDir);

    target.executeCommand("chroot {0} /bin/bash -c \"DEBIAN_FRONTEND=noninteractive dpkg-reconfigure locales\"",
        rootfsDir);

    if (!buildTar) {
      {
        File kernelImgConf = new File(rootfsDir, "etc/kernel-img.conf");
View Full Code Here

Examples of org.platformlayer.ops.OpsTarget.executeCommand()

        File preseedFile = new File(preseedTmpDir, "kernel.preseed");

        String preseedData = ResourceUtils.get(getClass(), "kernel.preseed");
        FileUpload.upload(target, preseedFile, preseedData);

        target.executeCommand(Command.build("cat {0} | chroot {1} debconf-set-selections", preseedFile,
            rootfsDir));
        apt.install(chrootTarget, kernelPackage);
      }
    }
View Full Code Here

Examples of org.platformlayer.ops.OpsTarget.executeCommand()

      if (recipe.addPackage.contains("jenkins")) {
        // It looks like jenkins doesn't honor policy-rc.d (?)
        // TODO: Fix this monstrosity...
        log.warn("Hard-coding service stop after jenkins installation");
        target.executeCommand(Command.build("chroot {0} /etc/init.d/jenkins stop", rootfsDir));
      }
    }

    apt.upgrade(chrootTarget);
    apt.clean(chrootTarget);
View Full Code Here

Examples of org.platformlayer.ops.OpsTarget.executeCommand()

    apt.clean(chrootTarget);

    if (!buildTar) {
      String uuid;
      {
        ProcessExecution uuidExecution = target.executeCommand("blkid -o value -s UUID {0}", loopbackPartition);
        uuid = uuidExecution.getStdOut().trim();
      }

      // Set up /etc/fstab
      String fstab = "# /etc/fstab: static file system information.\n";
View Full Code Here

Examples of org.platformlayer.ops.OpsTarget.executeCommand()

    String sql = String.format("ALTER USER postgres WITH PASSWORD '%s';", password);
    String psql = String.format("psql --command=\"%s\"", sql);
    Command command = Command.build("su postgres -c {0}", psql);

    target.executeCommand(command);
  }

  public static PostgresqlServerBootstrap build() {
    return Injection.getInstance(PostgresqlServerBootstrap.class);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.