Examples of executeCommand()


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

    OpsTarget target = OpsContext.get().getInstance(OpsTarget.class);

    String url = "http://nexus.sonatype.org/downloads/all/nexus-webapp-1.9.2.4.war";
    File warFile = new File("/var/lib/jetty/wars/nexus-webapp-1.9.2.4.war");

    target.executeCommand("wget {0} -O {1}", url, warFile);

    // Whatever version of nexus we have, we want it to be the root
    target.symlink(warFile, new File("/var/lib/jetty/webapps/root.war"), false);
  }
View Full Code Here

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

      FileUpload.upload(target, new File(rootfsDir, "etc/fstab"), fstab);
      log.info("fstab = " + fstab);

      // Set up extlinux
      {
        ProcessExecution kernelExecution = target.executeCommand("chroot {0} find boot/ -name \"vmlinuz-*\"",
            rootfsDir);
        List<String> kernels = Lists.newArrayList();
        for (String kernel : kernelExecution.getStdOut().split("\n")) {
          kernel = kernel.trim();
          if (kernel.isEmpty()) {
View Full Code Here

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

          throw new IllegalStateException("Multiple kernels found");
        } else if (kernels.size() != 1) {
          throw new IllegalStateException("No kernels found");
        }

        ProcessExecution initrdExecution = target.executeCommand("chroot {0} find boot/ -name \"initrd*\"",
            rootfsDir);
        List<String> initrds = Lists.newArrayList();
        for (String initrd : initrdExecution.getStdOut().split("\n")) {
          initrd = initrd.trim();
          if (initrd.isEmpty()) {
View Full Code Here

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

            "default linux\ntimeout 1\n\nlabel linux\nkernel %s\nappend initrd=%s root=UUID=%s ro quiet",
            kernels.get(0), initrds.get(0), uuid);
        FileUpload.upload(target, new File(rootfsDir, "extlinux.conf"), conf);
        log.info("extlinux.conf = " + conf);
      }
      target.executeCommand(Command.build("extlinux --install  {0}", rootfsDir).setTimeout(TimeSpan.FIVE_MINUTES));
    }

    if (supportCloudConfigDisk) {
      if (useConfigDriveSymlinks) {
        target.rm(new File(rootfsDir, "etc/network/interfaces"));
View Full Code Here

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

    }

    if (supportCloudConfigDisk) {
      if (useConfigDriveSymlinks) {
        target.rm(new File(rootfsDir, "etc/network/interfaces"));
        target.executeCommand("ln -s /media/config/etc/network/interfaces {0}", new File(rootfsDir,
            "etc/network/interfaces"));

        target.mkdir(new File(rootfsDir, "root/.ssh"));
        target.executeCommand("ln -s /media/config/root/.ssh/authorized_keys {0}", new File(rootfsDir,
            "root/.ssh/authorized_keys"));
View Full Code Here

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

        target.rm(new File(rootfsDir, "etc/network/interfaces"));
        target.executeCommand("ln -s /media/config/etc/network/interfaces {0}", new File(rootfsDir,
            "etc/network/interfaces"));

        target.mkdir(new File(rootfsDir, "root/.ssh"));
        target.executeCommand("ln -s /media/config/root/.ssh/authorized_keys {0}", new File(rootfsDir,
            "root/.ssh/authorized_keys"));
      } else {
        String initScript = ResourceUtils.get(getClass(), "openstack-config");
        File initScriptFile = new File(rootfsDir, "etc/init.d/openstack-config");
View Full Code Here

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

      } else {
        String initScript = ResourceUtils.get(getClass(), "openstack-config");
        File initScriptFile = new File(rootfsDir, "etc/init.d/openstack-config");

        FileUpload.upload(target, initScriptFile, initScript);
        target.executeCommand("chmod +x {0}", initScriptFile);

        chrootTarget.executeCommand("/usr/sbin/update-rc.d openstack-config defaults");
      }
    }
View Full Code Here

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

      // Remove policy file
      File policyFile = new File(rootfsDir, "usr/sbin/policy-rc.d");
      target.rm(policyFile);
    }

    target.executeCommand("sync");
    target.executeCommand("umount {0}", new File(rootfsDir, "proc"));

    if (!buildTar) {
      target.executeCommand("sync");
      target.executeCommand("umount {0}", rootfsDir);
View Full Code Here

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

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

    target.executeCommand("sync");
    target.executeCommand("umount {0}", new File(rootfsDir, "proc"));

    if (!buildTar) {
      target.executeCommand("sync");
      target.executeCommand("umount {0}", rootfsDir);
      target.executeCommand("sync");
View Full Code Here

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

    target.executeCommand("sync");
    target.executeCommand("umount {0}", new File(rootfsDir, "proc"));

    if (!buildTar) {
      target.executeCommand("sync");
      target.executeCommand("umount {0}", rootfsDir);
      target.executeCommand("sync");
      target.executeCommand("kpartx -d {0}", imageFile);
      target.executeCommand("sync");
    }
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.