Package com.caucho.env.repository

Examples of com.caucho.env.repository.CommitBuilder


    String sourceHost = args.getArg("-source-host");
   
    if (sourceHost == null)
      sourceHost = "default";

    CommitBuilder source = new CommitBuilder();
    source.type("webapp");

    String sourceStage = args.getArg("-source-stage");

    if (sourceStage != null)
      source.stage(sourceStage);

    source.tagKey(sourceHost + "/" + sourceContext);

    String version = args.getArg("-source-version");
    if (version != null)
      fillInVersion(source, version);

    String targetContext = args.getArg("-target");

    String targetHost = args.getArg("-target-host");

    if (targetHost == null)
      targetHost = sourceHost;

    CommitBuilder target = new CommitBuilder();
    target.type("webapp");

    String targetStage = args.getArg("-target-stage");

    if (targetStage != null)
      target.stage(targetStage);

    target.tagKey(targetHost + "/" + targetContext);

    String message = args.getArg("-m");

    if (message == null)
      message = args.getArg("-message");

    if (message == null)
      message = L.l("copy '{0}' to '{1}'", source.getTagKey(), target.getTagKey());

    target.message(message);

    target.attribute("user", System.getProperty("user.name"));

    String targetVersion = args.getArg("-target-version");
    if (targetVersion != null)
      fillInVersion(target, targetVersion);

    deployClient.copyTag(target, source);
   
    System.out.println(L.l("copied {0} to {1}",
                           source.getId(), target.getId()));
  }
View Full Code Here


    String host = args.getArg("-host");
   
    if (host == null)
      host = "default";
   
    CommitBuilder commit = new CommitBuilder();
    commit.type("webapp");
   
    String stage = args.getArg("-stage");
   
    if (stage != null)
      commit.stage(stage);
   
    Path path = Vfs.lookup(war);
   
    if (name == null) {
      String tail = path.getTail();
     
      int p = tail.lastIndexOf('.');

      name = tail.substring(0, p);
    }
   
    commit.tagKey(host + "/" + name);

    /*
    String tag = args.getArg("-tag");
    if (tag != null)
      commit.tagKey(tag);
      */
   
    if (! path.isFile()) {
      throw new ConfigException(L.l("'{0}' is not a readable file.",
                                    path.getFullPath()));
    }
   
    String message = args.getArg("-m");
   
    if (message == null)
      message = args.getArg("-message");
   
    if (message == null)
      message = "deploy " + war + " from command line";
   
    commit.message(message);
   
    commit.attribute("user", System.getProperty("user.name"));

    String version = args.getArg("-version");
    if (version != null)
      fillInVersion(commit, version);

    deployClient.commitArchive(commit, path);

    System.out.println("Deployed " + commit.getId() + " from " + war + " to "
                       + deployClient.getUrl());
  }
View Full Code Here

    String host = args.getArg("-host");
   
    if (host == null)
      host = "default";

    CommitBuilder commit = new CommitBuilder();
    commit.type("webapp");
   
    String stage = args.getArg("-stage");
   
    if (stage != null)
      commit.stage(stage);


    commit.tagKey(host + "/" + name);

    String message = args.getArg("-m");
   
    if (message == null)
      message = args.getArg("-message");
   
    if (message == null)
      message = "undeploy " + name + " from command line";
   
    commit.message(message);
   
    commit.attribute("user", System.getProperty("user.name"));

    String version = args.getArg("-version");
    if (version != null)
      fillInVersion(commit, version);
View Full Code Here

        xml.parse(deploymentPlanStream);

      String type = XPath.evalString("/deployment-plan/archive-type", doc);
      String name = XPath.evalString("/deployment-plan/name", doc);

      CommitBuilder commit = new CommitBuilder();
      if (type.equals("war"))
        commit.type("webapp");
      if (type.equals("ear"))
        commit.type("entapp");
      commit.tagKey("default/" + name);
      //String tag = type + "s/default/default/" + name;
/*
      HashMap<String,String> attributes = new HashMap<String,String>();
      attributes.put(DeployClient.USER_ATTRIBUTE, _user);
      attributes.put(DeployClient.MESSAGE_ATTRIBUTE, "");
*/
      if (archive != null)
        _deployClient.commitArchive(commit,
                                    Vfs.lookup(archive.getAbsolutePath()));
      else
        _deployClient.commitArchive(commit,
                                    archiveStream);
     
      String tag = commit.getId();

      _deployClient.deploy(tag);

      deployExtraFiles(tag, doc);

View Full Code Here

        TargetModuleID targetModuleID = moduleIDList[i];

        String host = targetModuleID.getTarget().getName();
        String tag = targetModuleID.getModuleID();
       
        CommitBuilder builder = new CommitBuilder();
        builder.type("webapp");
        builder.tagKey(tag);

        _deployClient.undeploy(builder);

        sb.append(tag).append(' ');
      }
View Full Code Here

    if (! archivePath.canRead())
      return true;
   
    String hash = Long.toHexString(archivePath.getCrc64());

    CommitBuilder commit = new CommitBuilder();
    commit.stage(getAutoDeployStage());
    commit.type(getIdType());
    commit.tagKey(getIdKey());

    String commitId = commit.getId();

    RepositoryTagEntry tagEntry = _repositorySpi.getTagMap().get(commitId);

    if (tagEntry != null
        && hash.equals(tagEntry.getAttributeMap().get("archive-digest"))) {
      return true;
    }

    commit.attribute("archive-digest", hash);
    commit.message(".war added to repository from "
                   + archivePath.getNativePath());

    if (log.isLoggable(Level.FINE))
      log.fine(this + " adding archive to repository from " + archivePath);
View Full Code Here

TOP

Related Classes of com.caucho.env.repository.CommitBuilder

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.