Package hudson.util

Examples of hudson.util.ArgumentListBuilder


  }

  private void zipAppFolderUsingShell(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener)
      throws IOException, InterruptedException {
    FilePath moduleRoot = build.getModuleRoot();
    ArgumentListBuilder args = new ArgumentListBuilder();
    args.add("zip");
    args.add("--quiet");
    args.add("--recurse-paths");
    args.add("-9");
    // make a relative path
    String appfolderPath = this.getAppFolder(moduleRoot).getRemote().substring(moduleRoot.getRemote().length() + 1);
    // the archive
    args.add(appfolderPath + ".zip");
    // the folder to archive
    args.add(appfolderPath);
    Map<String, String> env = build.getEnvironment(listener);
    int result = launcher.launch().cmds(args).pwd(moduleRoot).envs(env).stdout(listener).pwd(moduleRoot).join();
    if (result != 0) {
      throw new BuildFailedException();
    }
View Full Code Here


        if (this.needToCopyImage()
                && (!copyImage(listener, moduleRoot) || !copyChanges(listener, moduleRoot))) {
            return false;
        }
       
        ArgumentListBuilder args = new ArgumentListBuilder();
        args.add(getDescriptor().getVm());
        // add parameters
        String trimmed = Util.fixEmptyAndTrim(getDescriptor().getParameters());
        if (trimmed != null) {
            for (String each : trimmed.split(" ")) {
                if (each != null && !each.isEmpty()) {
                    args.add(each);
                }
            }
        }
        // add image
        args.add(getInputImage());
       
        Map<String, String> env = build.getEnvironment(listener);
        File script = this.getStartUpScript();
        try {
            args.add(script);
            int r = launcher.launch().cmds(args).envs(env).stdout(listener).pwd(moduleRoot).join();
            return r == 0;
        } catch (IOException e) {
            Util.displayIOException(e,listener);
View Full Code Here

      throws InterruptedException, IOException {

    FilePath moduleRoot = build.getModuleRoot();
    this.deleteDebugLog(moduleRoot);

    ArgumentListBuilder args = new ArgumentListBuilder();
    args.add(getDescriptor().getVm());
    addVmParametersTo(args);
    args.add(this.getImageFile(moduleRoot));
    args.add(this.getStartUpScript(moduleRoot));

   return this.startVm(build, launcher, listener, args);
  }
View Full Code Here

      throws InterruptedException, IOException {

    FilePath moduleRoot = build.getModuleRoot();
    this.deleteDebugLog(moduleRoot);

    ArgumentListBuilder args = new ArgumentListBuilder();
    args.add(getDescriptor().getVm());
    addVmParametersTo(args);
    args.add(this.getImageFile(moduleRoot));
    args.add(this.getStartUpScript(moduleRoot));

   return this.startVm(build, launcher, listener, args);
  }
View Full Code Here

      throws InterruptedException, IOException {

    FilePath moduleRoot = build.getModuleRoot();
    this.deleteDebugLog(moduleRoot);

    ArgumentListBuilder args = new ArgumentListBuilder();
    args.add(getDescriptor().getVm());
    addVmParametersTo(args);
    args.add(this.getImageFile(moduleRoot));
    args.add(this.getStartUpScript(moduleRoot));

   return this.startVm(build, launcher, listener, args);
  }
View Full Code Here

      throws InterruptedException, IOException {

    FilePath moduleRoot = build.getModuleRoot();
    this.deleteDebugLog(moduleRoot);

    ArgumentListBuilder args = new ArgumentListBuilder();
    args.add(getDescriptor().getVm());
    addVmParametersTo(args);
    args.add(this.getImageFile(moduleRoot));
    args.add(this.getStartUpScript(moduleRoot));

   return this.startVm(build, launcher, listener, args);
  }
View Full Code Here

  }

  private void zipAppFolderUsingShell(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener)
      throws IOException, InterruptedException {
    FilePath moduleRoot = build.getModuleRoot();
    ArgumentListBuilder args = new ArgumentListBuilder();
    args.add("zip");
    args.add("--quiet");
    args.add("--recurse-paths");
    args.add("-9");
    // make a relative path
    String appfolderPath = this.getAppFolder(moduleRoot).getRemote().substring(moduleRoot.getRemote().length() + 1);
    // the archive
    args.add(appfolderPath + ".zip");
    // the folder to archive
    args.add(appfolderPath);
    Map<String, String> env = build.getEnvironment(listener);
    int result = launcher.launch().cmds(args).pwd(moduleRoot).envs(env).stdout(listener).pwd(moduleRoot).join();
    if (result != 0) {
      throw new BuildFailedException();
    }
View Full Code Here

  }

  private void zipAppFolderUsingShell(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener)
      throws IOException, InterruptedException {
    FilePath moduleRoot = build.getModuleRoot();
    ArgumentListBuilder args = new ArgumentListBuilder();
    args.add("zip");
    args.add("--quiet");
    args.add("--recurse-paths");
    args.add("-9");
    // make a relative path
    String appfolderPath = this.getAppFolder(moduleRoot).getRemote().substring(moduleRoot.getRemote().length() + 1);
    // the archive
    args.add(appfolderPath + ".zip");
    // the folder to archive
    args.add(appfolderPath);
    Map<String, String> env = build.getEnvironment(listener);
    int result = launcher.launch().cmds(args).pwd(moduleRoot).envs(env).stdout(listener).pwd(moduleRoot).join();
    if (result != 0) {
      throw new BuildFailedException();
    }
View Full Code Here

    if (this.needToCopyImage()
        && (!copyImage(listener, moduleRoot) || !copyChanges(listener, moduleRoot))) {
      return false;
    }

    ArgumentListBuilder args = new ArgumentListBuilder();
    args.add(getDescriptor().getVm());
    addVmParametersTo(args);
    args.add(getImageToBuildAgainst(moduleRoot));

    Map<String, String> env = build.getEnvironment(listener);
    File script = this.getStartUpScript();
    try {
      args.add(script);
      return this.startVm(build, launcher, listener, args, env);
    } finally {
      if (!script.delete()) {
        listener.getLogger().println("[WARN] could not delete temp file");
      }
View Full Code Here

TOP

Related Classes of hudson.util.ArgumentListBuilder

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.