Examples of IGitblit


Examples of com.gitblit.manager.IGitblit

    @Option(name = "--noverify", usage = "Disable checksum verification")
    private boolean disableChecksum;

    @Override
    public void run() throws Failure {
      IGitblit gitblit = getContext().getGitblit();
      gitblit.refreshRegistry(!disableChecksum);
    }
View Full Code Here

Examples of com.gitblit.manager.IGitblit

    @Option(name = "--noverify", usage = "Disable checksum verification")
    private boolean disableChecksum;

    @Override
    protected List<PluginRegistration> getItems() throws UnloggedFailure {
      IGitblit gitblit = getContext().getGitblit();
      if (refresh) {
        gitblit.refreshRegistry(!disableChecksum);
      }

      List<PluginRegistration> list;
      if (updates) {
        list = gitblit.getRegisteredPlugins(InstallState.UPDATE_AVAILABLE);
      } else {
        list = gitblit.getRegisteredPlugins();
      }
      return list;
    }
View Full Code Here

Examples of com.gitblit.manager.IGitblit

    @Option(name = "--noverify", usage = "Disable checksum verification")
    private boolean disableChecksum;

    @Override
    public void run() throws Failure {
      IGitblit gitblit = getContext().getGitblit();
      try {
        String ulc = urlOrId.toLowerCase();
        if (ulc.startsWith("http://") || ulc.startsWith("https://")) {
          if (gitblit.installPlugin(urlOrId, !disableChecksum)) {
            stdout.println(String.format("Installed %s", urlOrId));
          } else {
            throw new UnloggedFailure(1, String.format("Failed to install %s", urlOrId));
          }
        } else {
          PluginRelease pr = gitblit.lookupRelease(urlOrId, version);
          if (pr == null) {
            throw new UnloggedFailure(1,  String.format("Plugin \"%s\" is not in the registry!", urlOrId));
          }

          // enforce minimum system requirement
          if (!StringUtils.isEmpty(pr.requires)) {
            Version requires = Version.createVersion(pr.requires);
            Version system = gitblit.getSystemVersion();
            boolean isValid = system.isZero() || system.atLeast(requires);
            if (!isValid) {
              String msg = String.format("Plugin \"%s:%s\" requires Gitblit %s",
                  urlOrId, pr.version, pr.requires);
              throw new UnloggedFailure(1, msg);
            }
          }

          if (gitblit.installPlugin(pr.url, !disableChecksum)) {
            stdout.println(String.format("Installed %s", urlOrId));
          } else {
            throw new UnloggedFailure(1, String.format("Failed to install %s", urlOrId));
          }
        }
View Full Code Here

Examples of com.gitblit.manager.IGitblit

    @Option(name = "--noverify", usage = "Disable checksum verification")
    private boolean disableChecksum;

    @Override
    public void run() throws Failure {
      IGitblit gitblit = getContext().getGitblit();
      PluginWrapper pluginWrapper = getPlugin(id);
      if (pluginWrapper == null) {
        throw new UnloggedFailure("Invalid plugin specified!");
      }

      PluginRelease pr = gitblit.lookupRelease(pluginWrapper.getPluginId(), version);
      if (pr == null) {
        throw new UnloggedFailure(1,  String.format("Plugin \"%s\" is not in the registry!", pluginWrapper.getPluginId()));
      }

      // enforce minimum system requirement
      if (!StringUtils.isEmpty(pr.requires)) {
        Version requires = Version.createVersion(pr.requires);
        Version system = gitblit.getSystemVersion();
        boolean isValid = system.isZero() || system.atLeast(requires);
        if (!isValid) {
          throw new Failure(1, String.format("Plugin \"%s:%s\" requires Gitblit %s",
              pluginWrapper.getPluginId(), pr.version, pr.requires));
        }
      }

      try {
        if (gitblit.upgradePlugin(pluginWrapper.getPluginId(), pr.url, !disableChecksum)) {
          stdout.println(String.format("Upgraded %s", pluginWrapper.getPluginId()));
        } else {
          throw new UnloggedFailure(1, String.format("Failed to upgrade %s", pluginWrapper.getPluginId()));
        }
      } catch (IOException e) {
View Full Code Here

Examples of com.gitblit.manager.IGitblit

    RuntimeManager runtime = new RuntimeManager(settings, xssFilter, baseFolder).start();
    NoopNotificationManager notifications = new NoopNotificationManager().start();
    UserManager users = new UserManager(runtime, null).start();
    RepositoryManager repositories = new RepositoryManager(runtime, null, users).start();
    FederationManager federation = new FederationManager(runtime, notifications, repositories).start();
    IGitblit gitblit = new GitblitManager(runtime, null, notifications, users, null, null, repositories, null, federation);

    FederationPullService puller = new FederationPullService(gitblit, federation.getFederationRegistrations()) {
      @Override
      public void reschedule(FederationModel registration) {
        // NOOP
View Full Code Here

Examples of com.gitblit.manager.IGitblit

    @Argument(index = 0, required = true, metaVar = "<ID>|<INDEX>", usage = "the plugin to uninstall")
    protected String id;

    @Override
    public void run() throws Failure {
      IGitblit gitblit = getContext().getGitblit();
      PluginWrapper pluginWrapper = getPlugin(id);
      if (pluginWrapper == null) {
        throw new UnloggedFailure(String.format("Plugin %s is not installed!", id));
      }

      if (gitblit.uninstallPlugin(pluginWrapper.getPluginId())) {
        stdout.println(String.format("Uninstalled %s", pluginWrapper.getPluginId()));
      } else {
        throw new UnloggedFailure(1, String.format("Failed to uninstall %s", pluginWrapper.getPluginId()));
      }
    }
View Full Code Here

Examples of com.gitblit.manager.IGitblit

      }
    });
  }

  protected String getHostname() {
    IGitblit gitblit = getContext().getGitblit();
    String host = null;
    String url = gitblit.getSettings().getString(Keys.web.canonicalUrl, "https://localhost:8443");
    if (url != null) {
      try {
        host = new URL(url).getHost();
      } catch (MalformedURLException e) {
      }
View Full Code Here

Examples of com.gitblit.manager.IGitblit

  @CommandMetaData(name = "list", aliases = { "ls" }, description = "List plugins")
  public static class ListPlugins extends ListCommand<PluginWrapper> {

    @Override
    protected List<PluginWrapper> getItems() throws UnloggedFailure {
      IGitblit gitblit = getContext().getGitblit();
      List<PluginWrapper> list = gitblit.getPlugins();
      return list;
    }
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.